Skip to content

Commit a52db02

Browse files
authored
Move away from the SSLEAY name (#1144)
1 parent a145fc3 commit a52db02

File tree

3 files changed

+35
-17
lines changed

3 files changed

+35
-17
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ Backward-incompatible changes:
1919
Deprecations:
2020
^^^^^^^^^^^^^
2121

22+
- ``OpenSSL.SSL.SSLeay_version`` is deprecated in favor of
23+
``OpenSSL.SSL.OpenSSL_version``. The constants ``OpenSSL.SSL.SSLEAY_*`` are
24+
deprecated in favor of ``OpenSSL.SSL.OPENSSL_*``.
25+
2226
Changes:
2327
^^^^^^^^
2428

doc/api/ssl.rst

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,20 @@ Context, Connection.
9898
:py:const:`OP_NO_*` constant may be undefined.
9999

100100

101-
.. py:data:: SSLEAY_VERSION
102-
SSLEAY_CFLAGS
103-
SSLEAY_BUILT_ON
104-
SSLEAY_PLATFORM
105-
SSLEAY_DIR
106-
107-
Constants used with :py:meth:`SSLeay_version` to specify what OpenSSL version
108-
information to retrieve. See the man page for the :py:func:`SSLeay_version` C
101+
.. py:data:: OPENSSL_VERSION
102+
OPENSSL_CFLAGS
103+
OPENSSL_BUILT_ON
104+
OPENSSL_PLATFORM
105+
OPENSSL_DIR
106+
107+
.. versionchanged:: 22.1.0
108+
109+
Previously these were all named ``SSLEAY_*``. Those names are still
110+
available for backwards compatibility, but the ``OPENSSL_*`` names are
111+
preferred.
112+
113+
Constants used with :py:meth:`OpenSSL_version` to specify what OpenSSL version
114+
information to retrieve. See the man page for the :py:func:`OpenSSL_version` C
109115
API for details.
110116

111117

@@ -141,7 +147,7 @@ Context, Connection.
141147
.. versionadded:: 19.1
142148

143149

144-
.. autofunction:: SSLeay_version
150+
.. autofunction:: OpenSSL_version
145151

146152

147153
.. py:data:: ContextType

src/OpenSSL/SSL.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
"SSLEAY_PLATFORM",
3333
"SSLEAY_DIR",
3434
"SSLEAY_BUILT_ON",
35+
"OPENSSL_VERSION",
36+
"OPENSSL_CFLAGS",
37+
"OPENSSL_PLATFORM",
38+
"OPENSSL_DIR",
39+
"OPENSSL_BUILT_ON",
3540
"SENT_SHUTDOWN",
3641
"RECEIVED_SHUTDOWN",
3742
"SSLv23_METHOD",
@@ -125,11 +130,11 @@
125130

126131

127132
OPENSSL_VERSION_NUMBER = _lib.OPENSSL_VERSION_NUMBER
128-
SSLEAY_VERSION = _lib.SSLEAY_VERSION
129-
SSLEAY_CFLAGS = _lib.SSLEAY_CFLAGS
130-
SSLEAY_PLATFORM = _lib.SSLEAY_PLATFORM
131-
SSLEAY_DIR = _lib.SSLEAY_DIR
132-
SSLEAY_BUILT_ON = _lib.SSLEAY_BUILT_ON
133+
OPENSSL_VERSION = SSLEAY_VERSION = _lib.OPENSSL_VERSION
134+
OPENSSL_CFLAGS = SSLEAY_CFLAGS = _lib.OPENSSL_CFLAGS
135+
OPENSSL_PLATFORM = SSLEAY_PLATFORM = _lib.OPENSSL_PLATFORM
136+
OPENSSL_DIR = SSLEAY_DIR = _lib.OPENSSL_DIR
137+
OPENSSL_BUILT_ON = SSLEAY_BUILT_ON = _lib.OPENSSL_BUILT_ON
133138

134139
SENT_SHUTDOWN = _lib.SSL_SENT_SHUTDOWN
135140
RECEIVED_SHUTDOWN = _lib.SSL_RECEIVED_SHUTDOWN
@@ -614,13 +619,16 @@ def _asFileDescriptor(obj):
614619
return fd
615620

616621

617-
def SSLeay_version(type):
622+
def OpenSSL_version(type):
618623
"""
619624
Return a string describing the version of OpenSSL in use.
620625
621-
:param type: One of the :const:`SSLEAY_` constants defined in this module.
626+
:param type: One of the :const:`OPENSSL_` constants defined in this module.
622627
"""
623-
return _ffi.string(_lib.SSLeay_version(type))
628+
return _ffi.string(_lib.OpenSSL_version(type))
629+
630+
631+
SSLeay_version = OpenSSL_version
624632

625633

626634
def _make_requires(flag, error):

0 commit comments

Comments
 (0)