diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2019-10-18 08:47:15 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2019-10-18 20:47:15 +0800 |
commit | 1c186772f6fd64180bd3387de2e1ef1a6d1ba58e (patch) | |
tree | a3a95a96a5e4b21d80d0529df79d5d4a71070082 /src | |
parent | a1307a1f34e4f6f8f124cde92ec53c4cd0580078 (diff) | |
download | cryptography-1c186772f6fd64180bd3387de2e1ef1a6d1ba58e.tar.gz cryptography-1c186772f6fd64180bd3387de2e1ef1a6d1ba58e.tar.bz2 cryptography-1c186772f6fd64180bd3387de2e1ef1a6d1ba58e.zip |
Fixes #5018 -- break users on OpenSSL 1.0.1 (#5022)
* Fixes #5018 -- break users on OpenSSL 1.0.1
* Grammar
* Syntax error
* Missing import
* Missing import
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/hazmat/bindings/openssl/binding.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/cryptography/hazmat/bindings/openssl/binding.py b/src/cryptography/hazmat/bindings/openssl/binding.py index 97405162..1e0f34c9 100644 --- a/src/cryptography/hazmat/bindings/openssl/binding.py +++ b/src/cryptography/hazmat/bindings/openssl/binding.py @@ -5,6 +5,7 @@ from __future__ import absolute_import, division, print_function import collections +import os import threading import types import warnings @@ -156,12 +157,19 @@ def _verify_openssl_version(lib): lib.CRYPTOGRAPHY_OPENSSL_LESS_THAN_102 and not lib.CRYPTOGRAPHY_IS_LIBRESSL ): - warnings.warn( - "OpenSSL version 1.0.1 is no longer supported by the OpenSSL " - "project, please upgrade. The next version of cryptography will " - "drop support for it.", - utils.CryptographyDeprecationWarning - ) + if os.environ.get("CRYPTOGRAPHY_ALLOW_OPENSSL_101"): + warnings.warn( + "OpenSSL version 1.0.1 is no longer supported by the OpenSSL " + "project, please upgrade. The next version of cryptography " + "will completely remove support for it.", + utils.CryptographyDeprecationWarning + ) + else: + raise RuntimeError( + "You are linking against OpenSSL 1.0.1, which is no longer " + "supported by the OpenSSL project. You need to upgrade to a " + "newer version of OpenSSL." + ) def _verify_package_version(version): |