aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/bindings/openssl/binding.py20
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):