Weird SSL problem

Roland Hedberg roland.hedberg at adm.umu.se
Mon Sep 29 05:12:15 EDT 2014


Hi!

I’m trying to access 
https://stsadweb.one.microsoft.com/adfs/.well-known/openid-configuration

Doing it the simplest way I get the following:

>>> import urllib
>>> f = urllib.urlopen("https://stsadweb.one.microsoft.com/adfs/.well-known/openid-configuration")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 87, in urlopen
    return opener.open(url)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 208, in open
    return getattr(self, name)(url)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 437, in open_https
    h.endheaders(data)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 969, in endheaders
    self._send_output(message_body)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 829, in _send_output
    self.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 791, in send
    self.connect()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1176, in connect
    self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 387, in wrap_socket
    ciphers=ciphers)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 143, in __init__
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 305, in do_handshake
    self._sslobj.do_handshake()
IOError: [Errno socket error] [Errno 54] Connection reset by peer
>>> import ssl
>>> ssl.OPENSSL_VERSION
’OpenSSL 0.9.8za 5 Jun 2014'

Now, using Safari, or curl for that matter, from the same machine works without a hitch.

The URL above is also the only URL I’ve encountered this problem with.

Anyone got an idea ?

— Roland

”Being able to think like a child is an important attribute of being an adult” - Eddie Izzard




More information about the Python-list mailing list