Skip to content

Commit

Permalink
Move away from the SSLEAY name (#1144)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex authored Sep 16, 2022
1 parent a145fc3 commit a52db02
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Backward-incompatible changes:
Deprecations:
^^^^^^^^^^^^^

- ``OpenSSL.SSL.SSLeay_version`` is deprecated in favor of
``OpenSSL.SSL.OpenSSL_version``. The constants ``OpenSSL.SSL.SSLEAY_*`` are
deprecated in favor of ``OpenSSL.SSL.OPENSSL_*``.

Changes:
^^^^^^^^

Expand Down
24 changes: 15 additions & 9 deletions doc/api/ssl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,20 @@ Context, Connection.
:py:const:`OP_NO_*` constant may be undefined.


.. py:data:: SSLEAY_VERSION
SSLEAY_CFLAGS
SSLEAY_BUILT_ON
SSLEAY_PLATFORM
SSLEAY_DIR
Constants used with :py:meth:`SSLeay_version` to specify what OpenSSL version
information to retrieve. See the man page for the :py:func:`SSLeay_version` C
.. py:data:: OPENSSL_VERSION
OPENSSL_CFLAGS
OPENSSL_BUILT_ON
OPENSSL_PLATFORM
OPENSSL_DIR
.. versionchanged:: 22.1.0

Previously these were all named ``SSLEAY_*``. Those names are still
available for backwards compatibility, but the ``OPENSSL_*`` names are
preferred.

Constants used with :py:meth:`OpenSSL_version` to specify what OpenSSL version
information to retrieve. See the man page for the :py:func:`OpenSSL_version` C
API for details.


Expand Down Expand Up @@ -141,7 +147,7 @@ Context, Connection.
.. versionadded:: 19.1


.. autofunction:: SSLeay_version
.. autofunction:: OpenSSL_version


.. py:data:: ContextType
Expand Down
24 changes: 16 additions & 8 deletions src/OpenSSL/SSL.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
"SSLEAY_PLATFORM",
"SSLEAY_DIR",
"SSLEAY_BUILT_ON",
"OPENSSL_VERSION",
"OPENSSL_CFLAGS",
"OPENSSL_PLATFORM",
"OPENSSL_DIR",
"OPENSSL_BUILT_ON",
"SENT_SHUTDOWN",
"RECEIVED_SHUTDOWN",
"SSLv23_METHOD",
Expand Down Expand Up @@ -125,11 +130,11 @@


OPENSSL_VERSION_NUMBER = _lib.OPENSSL_VERSION_NUMBER
SSLEAY_VERSION = _lib.SSLEAY_VERSION
SSLEAY_CFLAGS = _lib.SSLEAY_CFLAGS
SSLEAY_PLATFORM = _lib.SSLEAY_PLATFORM
SSLEAY_DIR = _lib.SSLEAY_DIR
SSLEAY_BUILT_ON = _lib.SSLEAY_BUILT_ON
OPENSSL_VERSION = SSLEAY_VERSION = _lib.OPENSSL_VERSION
OPENSSL_CFLAGS = SSLEAY_CFLAGS = _lib.OPENSSL_CFLAGS
OPENSSL_PLATFORM = SSLEAY_PLATFORM = _lib.OPENSSL_PLATFORM
OPENSSL_DIR = SSLEAY_DIR = _lib.OPENSSL_DIR
OPENSSL_BUILT_ON = SSLEAY_BUILT_ON = _lib.OPENSSL_BUILT_ON

SENT_SHUTDOWN = _lib.SSL_SENT_SHUTDOWN
RECEIVED_SHUTDOWN = _lib.SSL_RECEIVED_SHUTDOWN
Expand Down Expand Up @@ -614,13 +619,16 @@ def _asFileDescriptor(obj):
return fd


def SSLeay_version(type):
def OpenSSL_version(type):
"""
Return a string describing the version of OpenSSL in use.
:param type: One of the :const:`SSLEAY_` constants defined in this module.
:param type: One of the :const:`OPENSSL_` constants defined in this module.
"""
return _ffi.string(_lib.SSLeay_version(type))
return _ffi.string(_lib.OpenSSL_version(type))


SSLeay_version = OpenSSL_version


def _make_requires(flag, error):
Expand Down

0 comments on commit a52db02

Please sign in to comment.