{"action":"created","issue":{"url":"https://api.github.com/repos/imageio/imageio/issues/318","repository_url":"https://api.github.com/repos/imageio/imageio","labels_url":"https://api.github.com/repos/imageio/imageio/issues/318/labels{/name}","comments_url":"https://api.github.com/repos/imageio/imageio/issues/318/comments","events_url":"https://api.github.com/repos/imageio/imageio/issues/318/events","html_url":"https://github.com/imageio/imageio/issues/318","id":304532792,"number":318,"title":"SSL Certificate error downloading ffmpeg on mac (switch to requests?)","user":{"login":"peircej","id":380582,"avatar_url":"https://avatars2.githubusercontent.com/u/380582?v=4","gravatar_id":"","url":"https://api.github.com/users/peircej","html_url":"https://github.com/peircej","followers_url":"https://api.github.com/users/peircej/followers","following_url":"https://api.github.com/users/peircej/following{/other_user}","gists_url":"https://api.github.com/users/peircej/gists{/gist_id}","starred_url":"https://api.github.com/users/peircej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peircej/subscriptions","organizations_url":"https://api.github.com/users/peircej/orgs","repos_url":"https://api.github.com/users/peircej/repos","events_url":"https://api.github.com/users/peircej/events{/privacy}","received_events_url":"https://api.github.com/users/peircej/received_events","type":"User","site_admin":false},"labels":[{"id":143381939,"url":"https://api.github.com/repos/imageio/imageio/labels/core","name":"core","color":"207de5","default":false},{"id":38460463,"url":"https://api.github.com/repos/imageio/imageio/labels/type:%20question","name":"type: question","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-03-12T20:43:58Z","updated_at":"2018-04-29T16:29:53Z","closed_at":null,"author_association":"NONE","body":"Hi there, \r\n\r\nI'm getting the following errors trying to download ffmpeg on a mac (10.13.3) with Python3.6 or Python2.7. I'm pretty sure the issue here is that the packaged urllib is useless on the mac! It has long been known that it fails to find the right certificates and this has just recently affected the ffmpeg download from imageio (I imagine a certificate has recently changed at github?)\r\n\r\nAnyway, the long and short of it is that this can be fixed by `pip install requests[security]` and then\r\n```\r\nimport requests\r\n\r\nurl = \"https://github.com/imageio/imageio-binaries/raw/master/ffmpeg/ffmpeg-osx-v3.3.1\"\r\nresponse = requests.get(url)\r\nif response.status_code == 200:\r\n    with open(download_location, 'wb') as f:\r\n        f.write(response.content)\r\n```\r\n\r\nIt isn't quite as simple as `urlopen()` and it means a new dependency but then much more robust downloading (for mac users). I guess you could make things more ugly by using `urlopen()` on win/linux and only use requests on OSX. \r\n\r\nthoughts?\r\n\r\n\r\n## Errors:\r\nPython 3.6:\r\n```\r\n>>> from urllib.request import urlopen \r\n>>> url = 'https://github.com/imageio/imageio-binaries/tree/master/ffmpeg/ffmpeg-osx-v3.3.1'\r\n>>> a = urlopen(url)\r\nTraceback (most recent call last):\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py\", line 1318, in do_open\r\n    encode_chunked=req.has_header('Transfer-encoding'))\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py\", line 1239, in request\r\n    self._send_request(method, url, body, headers, encode_chunked)\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py\", line 1285, in _send_request\r\n    self.endheaders(body, encode_chunked=encode_chunked)\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py\", line 1234, in endheaders\r\n    self._send_output(message_body, encode_chunked=encode_chunked)\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py\", line 1026, in _send_output\r\n    self.send(msg)\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py\", line 964, in send\r\n    self.connect()\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py\", line 1400, in connect\r\n    server_hostname=server_hostname)\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py\", line 401, in wrap_socket\r\n    _context=self, _session=session)\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py\", line 808, in __init__\r\n    self.do_handshake()\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py\", line 1061, in do_handshake\r\n    self._sslobj.do_handshake()\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py\", line 683, in do_handshake\r\n    self._sslobj.do_handshake()\r\nssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)\r\n```\r\n\r\nPython2.7:\r\n```\r\n>>> from urllib import urlopen\r\n>>> url = 'https://github.com/imageio/imageio-binaries/raw/master/ffmpeg/ffmpeg-osx-v3.3.1'\r\n>>> urlopen(url)\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py\", line 87, in urlopen\r\n    return opener.open(url)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py\", line 213, in open\r\n    return getattr(self, name)(url)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py\", line 443, in open_https\r\n    h.endheaders(data)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 1053, in endheaders\r\n    self._send_output(message_body)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 897, in _send_output\r\n    self.send(msg)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 859, in send\r\n    self.connect()\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py\", line 1278, in connect\r\n    server_hostname=server_hostname)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py\", line 353, in wrap_socket\r\n    _context=self)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py\", line 601, in __init__\r\n    self.do_handshake()\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py\", line 830, in do_handshake\r\n    self._sslobj.do_handshake()\r\nIOError: [Errno socket error] [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/imageio/imageio/issues/comments/385263470","html_url":"https://github.com/imageio/imageio/issues/318#issuecomment-385263470","issue_url":"https://api.github.com/repos/imageio/imageio/issues/318","id":385263470,"user":{"login":"Schrodinger1926","id":9752908,"avatar_url":"https://avatars3.githubusercontent.com/u/9752908?v=4","gravatar_id":"","url":"https://api.github.com/users/Schrodinger1926","html_url":"https://github.com/Schrodinger1926","followers_url":"https://api.github.com/users/Schrodinger1926/followers","following_url":"https://api.github.com/users/Schrodinger1926/following{/other_user}","gists_url":"https://api.github.com/users/Schrodinger1926/gists{/gist_id}","starred_url":"https://api.github.com/users/Schrodinger1926/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Schrodinger1926/subscriptions","organizations_url":"https://api.github.com/users/Schrodinger1926/orgs","repos_url":"https://api.github.com/users/Schrodinger1926/repos","events_url":"https://api.github.com/users/Schrodinger1926/events{/privacy}","received_events_url":"https://api.github.com/users/Schrodinger1926/received_events","type":"User","site_admin":false},"created_at":"2018-04-29T16:29:53Z","updated_at":"2018-04-29T16:29:53Z","author_association":"NONE","body":"Immediate **hack**\r\n\r\n`cd /Users/sidharth/Library/Application\\ Support/imageio`\r\n`mkdir ffmpeg`\r\n`cd ffmpeg`\r\n`wget https://github.com/imageio/imageio-binaries/raw/master/ffmpeg/ffmpeg-osx-v3.2.4`\r\n\r\nNOTE: do NOT supply any path to directory argument of `imageio.plugins.ffmeg.download(directory = None)` \r\n"}}
{"actor":{"display_login":"Schrodinger1926"}}