Friday, September 22, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  17] [ 0]  / answers: 1 / hits: 62891  / 2 Years ago, thu, september 2, 2021, 12:44:15

I have an little app I wrote in Python and it used to work... until yesterday, when it suddenly started giving me an error in a HTTPS connection. I don't remember if there was an update, but both Python 2.7.3rc2 and Python 3.2 are failing just the same.

I googled it and found out that this happens when people are behind a proxy, but I'm not (and nothing have changed in my network since the last time it worked). My syster's computer running windows and Python 2.7.2 has no problems (in the same network).

>>> url = ''
>>> response = urllib2.urlopen(url).read()
File "/usr/lib/python2.7/", line 126, in urlopen
return, data, timeout)
File "/usr/lib/python2.7/", line 400, in open
response = self._open(req, data)
File "/usr/lib/python2.7/", line 418, in _open
'_open', req)
File "/usr/lib/python2.7/", line 378, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/", line 1215, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/", line 1177, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 8] _ssl.c:504: EOF occurred in violation of protocol>

What's wrong? Any help is appreciated.

PS.: Older python versions don't work either, not in my system and not in a live session from USB, but DO work in a Ubuntu 11.10 live session.

More From » 12.04


This appears to be related to the addition of TLS 1.1 and 1.2 support to the version of OpenSSL found in 12.04. The connection failure can be reproduced with the OpenSSL command line tool:

$ openssl s_client -connect
140491065808544:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:177:
no peer certificate available
No client certificate CA names sent
SSL handshake has read 0 bytes and written 320 bytes
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE

The connection succeeds if I force the connection to use TLS 1.0 with the -tls1 command line argument.

I would suggest you file a bug report about this problem here:

[#39665] Thursday, September 2, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 24
Total Questions: 105
Total Answers: 109

Location: Western Sahara
Member since Tue, Feb 16, 2021
3 Years ago
fieldcheon questions
Fri, Apr 1, 22, 05:58, 2 Years ago
Wed, Feb 2, 22, 03:31, 2 Years ago
Sat, Aug 14, 21, 01:24, 2 Years ago