Skip to content

Commit 932ffb7

Browse files
authored
Deprecate OpenSSL<3 (#13213)
1 parent e00cd77 commit 932ffb7

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Changelog
99
.. note:: This version is not yet released and is under active development.
1010

1111
* **BACKWARDS INCOMPATIBLE:** Support for Python 3.7 has been removed.
12+
* Support for OpenSSL < 3.0 is deprecated and will be removed in the next
13+
release.
1214
* Removed the deprecated ``get_attribute_for_oid`` method on
1315
:class:`~cryptography.x509.CertificateSigningRequest`. Users should use
1416
:meth:`~cryptography.x509.Attributes.get_attribute_for_oid` instead.

src/cryptography/hazmat/bindings/openssl/binding.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from cryptography.exceptions import InternalError
1717
from cryptography.hazmat.bindings._rust import _openssl, openssl
1818
from cryptography.hazmat.bindings.openssl._conditional import CONDITIONAL_NAMES
19+
from cryptography.utils import CryptographyDeprecationWarning
1920

2021

2122
def _openssl_assert(ok: bool) -> None:
@@ -120,3 +121,17 @@ def _verify_package_version(version: str) -> None:
120121
UserWarning,
121122
stacklevel=2,
122123
)
124+
125+
if (
126+
not openssl.CRYPTOGRAPHY_IS_LIBRESSL
127+
and not openssl.CRYPTOGRAPHY_IS_BORINGSSL
128+
and not openssl.CRYPTOGRAPHY_IS_AWSLC
129+
and not openssl.CRYPTOGRAPHY_OPENSSL_300_OR_GREATER
130+
):
131+
warnings.warn(
132+
"You are using OpenSSL < 3.0. Support for OpenSSL < 3.0 is deprecated "
133+
"and will be removed in the next release. Please upgrade to OpenSSL "
134+
"3.0 or later.",
135+
CryptographyDeprecationWarning,
136+
stacklevel=2,
137+
)

0 commit comments

Comments
 (0)