Legacy Unsafe Renegotiation Error

brown padlock on brown wooden post

If you are getting SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED when connecting to an HTTPS site using Python, create the openssl.conf somewhere with the following content:

openssl_conf = openssl_init

[openssl_init]
ssl_conf = ssl_sect

[ssl_sect]
system_default = system_default_sect

[system_default_sect]
Options = UnsafeLegacyRenegotiation

You can then run your Python program by specifying the path of this file in the OPENSSL_CONF environment variable:

$ OPENSSL_CONF=openssl.conf python3 my_app.py

See this StackOverflow question for the details: https://stackoverflow.com/questions/71603314/ssl-error-unsafe-legacy-renegotiation-disabled

Comment

Your email address will not be published. Required fields are marked *