Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github blocks download request for zip files! #194

Closed
mostaphaRoudsari opened this issue Oct 16, 2014 · 5 comments
Closed

Github blocks download request for zip files! #194

mostaphaRoudsari opened this issue Oct 16, 2014 · 5 comments
Assignees
Labels
Milestone

Comments

@mostaphaRoudsari
Copy link
Member

http://www.grasshopper3d.com/group/ladybug/forum/topics/fail-to-update-hb-and-lb

@mostaphaRoudsari
Copy link
Member Author

I spent few hours today and tried to find a clean way to address this issue. My understanding is that urllib cannot make a secure connection to download the file. The issue is inside ssl.py. The solution should be here but I couldn't really get it to work: http://blogs.msdn.com/b/jpsanders/archive/2009/01/07/you-receive-one-or-more-error-messages-when-you-try-to-make-an-http-request-in-an-application-that-is-built-on-the-net-framework-2-0.aspx

Here is very similar discussion: http://forums.asp.net/t/1622470.aspx?Error+Authentication+failed+because+the+remote+party+has+closed+the+transport+stream+

One alternative is to use browser to download the files, and the browser takes care of connection certificate but it will be really dirty! Maybe this is a great chance to send my first question ever to stackoverflow.

@mostaphaRoudsari
Copy link
Member Author

Actually any https request fails, including downloading the files from dropbox link! Very strange.

import urllib

url = "https://dl.dropboxusercontent.com/u/16228160/honeybee/versions.txt"
webFile = urllib.urlopen(url)
versions= eval(webFile.read())
webFile.close()

print versions

@mostaphaRoudsari
Copy link
Member Author

Using ProxyHandler solves the issue but it includes some risk. I assume there should be a better way. I just leave this open for now.

import urllib2
proxy_support = urllib2.ProxyHandler({"http":"http://61.233.25.166:80"})
opener = urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)

@mostaphaRoudsari mostaphaRoudsari added this to the January 2015 milestone Jan 21, 2015
mostaphaRoudsari added a commit to ladybug-tools/ladybug-legacy that referenced this issue Jan 21, 2015
@mostaphaRoudsari
Copy link
Member Author

Turns out this is a bug in IronPython 2.7, replacing ssl.py with old version from 2.6 solves the problem.

@mostaphaRoudsari
Copy link
Member Author

Not really! It didn't work for other users...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant