Search code examples
pythonpython-3.xopensslurllib

No Default Ciphers attribute in urllib3?


Here's an odd one in python 3.6, Mac OS X 10.14.3. In python (installed via Homebrew), I type:

import requests
print(requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS)

and python yells at me:

AttributeError: module 'requests.packages.urllib3.util.ssl_' has no attribute 'DEFAULT_CIPHERS'

Yet when I ask openssl the same:

openssl ciphers `python -c "import requests; print(requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS)"`

I get a nice long list of all the ciphers on the system.

Does anyone know how to get python and openssl to play nicely in this example and see the cipher list? openssl, python, urllib3, etc. are all installed and up to date.


Solution

  • Turns out requests was badly out of date after all. Fixed!