Python error sslv3 alert handshake failure

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

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

[ssl-issues] sslv3 alert handshake failure on Debian System #330

[ssl-issues] sslv3 alert handshake failure on Debian System #330

Comments

After experiencing #323 I switched to your project as it seems to be better maintained and downloaded the master branch. The problem is not fixed for me. But if I replace «AUTH_URL_V3» by «AUTH_URL» in coockies.py, line 116 I can use the downloader.

Unmodified master branch output:

$ ./coursera-dl --clear-cache -n ~/.netrc globalaffairsfinal-001 Downloading class: globalaffairsfinal-001 Starting new HTTPS connection (1): class.coursera.org /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Starting new HTTPS connection (1): www.coursera.org /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Traceback (most recent call last): File "./coursera-dl", line 6, in coursera_dl.main() File "/home/lobo32/coursera-dl/coursera/coursera_dl.py", line 932, in main result = download_class(args, class_name) File "/home/lobo32/coursera-dl/coursera/coursera_dl.py", line 828, in download_class username=args.username, password=args.password File "/home/lobo32/coursera-dl/coursera/cookies.py", line 339, in get_cookies_for_class get_authentication_cookies(session, class_name, username, password) File "/home/lobo32/coursera-dl/coursera/cookies.py", line 162, in get_authentication_cookies login(session, username, password, class_name=class_name) File "/home/lobo32/coursera-dl/coursera/cookies.py", line 117, in login headers=headers, allow_redirects=False) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 507, in post return self.request('POST', url, data=data, json=json, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 464, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 576, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 431, in send raise SSLError(e, request=request) requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure 

The text was updated successfully, but these errors were encountered:

Читайте также:  Css if class exists

The version of the python Debian package is 2.7.3-4+deb7u1. It is the current version in Debian Wheezy. But soon Debian Jessie will become stable which means that I (as well as many other Debian users) will upgrade and then have python 2.7.9.

$ python Python 2.7.3 (default, Mar 13 2014, 11:03:55) [GCC 4.7.2] on linux2 

On Apr 04 2015, MatthiasJaeger wrote:

After experiencing #323 I switched to your project as it seems to be
better maintained and downloaded the master branch.

Oh, super nice. I’ll take that as a compliment! 🙂

The problem is not fixed for me. But if I replace «AUTH_URL_V3» by
«AUTH_URL» in coockies.py, line 116 I can use the downloader.

OK. I will see what I can do. I do have interest in having even older
version of Debian working, but I am 100% of the time working with Debian
testing or unstable (I am a Debian Maintainer myself).

So you said that substituting AUTH_URL_V3 with AUTH_URL makes things work
again for you? Usually, these problems with SSL happen deep down in
OpenSSL, but some can be worked around in Python. If that’s the case, then I
may change things (or, at least, create a command-line option for users to
select which auth URL to use).

Do you happen to use any on-demand course or only regular ones? I’m just
checking since coursera is a moving target and we essentially have to follow
what they do there.

I have modified my local copy to use AUTH_URL instead of AUTH_URL_V3 and, as you suggested, things seem to work fine for me. But I guess that I am not really a valuable data point, since I was unaffected by Coursera’s removal of SSLv3 (read: everything used to work fine with me either way).

It would be nice to have more people testing these changes before I go ahead and commit a change to our repository.

Hi. I have a really hard time getting coursera-dl to work again and I’m running out of ideas.
I still get «urlopen error [Errno 1] _ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure» when trying to get anything.

  • I upgraded to Linux Mint 17.1 Rebecca (Ubuntu 14.04 LTS)
  • I built python 2.7.9 from source (python -V : Python 2.7.9)
  • I tried updating coursera-dl with pip : sudo -H pip install coursera-dl -U
  • I tried cloning this repository but cannot get it to work : ./coursera-dl -> «ImportError: No module named requests» (and yes, everything is already up to date with «sudo -H pip install -r requirements.txt -U»)
  • I installed lot’s of stuff from various posts (stackoverflow, . )

Please, tell me what to do in order to resume downloading my 70+ courses !

Please tell me if there is anything else I can test to help you. I originally tested it on a normal course and a final project.

Now I also tried testing it for an on-demand course. It shows the same problem, but even after substituting AUTH_URL_V3 with AUTH_URL this doesn’t work and a simmilar problem seems to arrise from a different source. But since I never tried before and therefore never successfully downloaded a on-demand course I might be doing something wrong there . The test and output with AUTH_URL_V3 :

$ ./coursera-dl --clear-cache --on-demand -n .netrc learn-chinese Downloading class: learn-chinese Starting new HTTPS connection (1): www.coursera.org /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Traceback (most recent call last): File "./coursera-dl", line 6, in coursera_dl.main() File "/home/lobo32/coursera-dl/coursera/coursera_dl.py", line 930, in main result = download_on_demand_class(args, class_name) File "/home/lobo32/coursera-dl/coursera/coursera_dl.py", line 873, in download_on_demand_class login(session, args.username, args.password) File "/home/lobo32/coursera-dl/coursera/cookies.py", line 117, in login headers=headers, allow_redirects=False) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 507, in post return self.request('POST', url, data=data, json=json, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 464, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 576, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 431, in send raise SSLError(e, request=request) requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure 

The test and output with AUTH_URL :

 ./coursera-dl --clear-cache --on-demand -n .netrc learn-chinese Downloading class: learn-chinese Starting new HTTPS connection (1): accounts.coursera.org /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Logged in on coursera.org. Starting new HTTPS connection (1): www.coursera.org /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Traceback (most recent call last): File "./coursera-dl", line 6, in coursera_dl.main() File "/home/lobo32/coursera-dl/coursera/coursera_dl.py", line 930, in main result = download_on_demand_class(args, class_name) File "/home/lobo32/coursera-dl/coursera/coursera_dl.py", line 876, in download_on_demand_class page = get_on_demand_syllabus(session, class_name) File "/home/lobo32/coursera-dl/coursera/coursera_dl.py", line 202, in get_on_demand_syllabus page = get_page(session, url) File "/home/lobo32/coursera-dl/coursera/coursera_dl.py", line 129, in get_page r = session.get(url) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 476, in get return self.request('GET', url, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 464, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 576, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 431, in send raise SSLError(e, request=request) requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure 

While set to AUTH_URL and downloading a normal course it works but it produces warning messages for insecure connections:

$ ./coursera-dl -n .netrc globalaffairsfinal-001 Downloading class: globalaffairsfinal-001 Starting new HTTPS connection (1): class.coursera.org /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Starting new HTTPS connection (1): accounts.coursera.org /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Logged in on coursera.org. Starting new HTTPS connection (1): class.coursera.org /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Found authentication cookies. Downloaded https://class.coursera.org/globalaffairsfinal-001/lecture/index (24771 bytes) (. ) 

Источник

Оцените статью