Modules

Jan 14, 2021

NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the ‘ssl’ module is compiled with ‘LibreSSL 2.8.3’

Getting following error when I try to execute a get request using python request on MacOS. How can I fix this error?

Error

NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020

Why is This Error?

The error message “NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the ‘ssl’ module is compiled with ‘LibreSSL 2.8.3’” indicates an incompatibility between the version of OpenSSL required by the urllib3 library (specifically version 2.0) and the version currently installed on your system (LibreSSL 2.8.3).

Here’s a breakdown of the key components of the error

NotOpenSSLWarning: This is a warning category indicating an issue related to OpenSSL.

urllib3 v2.0 only supports OpenSSL 1.1.1+: Specifies the version requirement for OpenSSL by urllib3 version 2.0.

currently the ‘ssl’ module is compiled with ‘LibreSSL 2.8.3’: Indicates the current version of the ssl module, which is compiled with LibreSSL 2.8.3. However, this version of LibreSSL is not compatible with urllib3 v2.0’s OpenSSL requirement.

To address this error, you can consider the following steps

Upgrade OpenSSL or Install Compatible Version: Upgrade OpenSSL on your system to a version that meets the requirement of urllib3 v2.0 (1.1.1 or higher). Alternatively, you may need to install a version of OpenSSL that is compatible with urllib3 v2.0.

Check System Libraries: Ensure that the ssl module and other system libraries are in sync with the version of OpenSSL that you want to use. Some libraries might be linked against a specific version of OpenSSL.

Virtual Environment: If you are working in a virtual environment, make sure that it is correctly set up to use the desired version of OpenSSL.

Check Dependency Versions: Review the versions of urllib3 and other dependencies in your project. It’s possible that other libraries have version requirements that may conflict with each other.

Review System Package Manager: Depending on your operating system, you might use a package manager (e.g., apt, yum, brew) to manage system libraries. Ensure that the correct version of OpenSSL is installed and that it is accessible to your Python environment.

Consider Updating Python: In some cases, updating your Python version may come with updated dependencies, including OpenSSL. Ensure that your Python version is up to date.

By addressing the version mismatch between urllib3 requirements and the installed OpenSSL version, you should be able to resolve the “NotOpenSSLWarning” error. Be mindful of potential compatibility issues and ensure that your environment is configured correctly.

Comments

  • Avatar

    Danielle Carline

    Posted on

    Downgrade your openssl version and urllib3 version just by running following commands. As error suggest, you can find the good explanation about this error here.

    brew install [email protected]
    pip3 uninstall urllib3
    pip3 install urllib3==1.26.6
    

Write a comment

You can use the Markdown syntax to format your comment.

Tags: python