Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 279
Christopher Penn Avatar asked Mar 09 '26 03:03

Christopher Penn


1 Answers

I'm able to reproduce the error.

  • python 3.8.16
  • requests 2.30.0

it work fine for me after downgrade to requests==2.28.2

Hope it helps

like image 199
Donald Tse Avatar answered Mar 11 '26 17:03

Donald Tse



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!