Skip to content

Commit b8d0fa0

Browse files
authored
bpo-43669: Remove OpenSSL 0.9 to 1.1.0 specific documentation (GH-25453)
1 parent ea39f82 commit b8d0fa0

File tree

4 files changed

+12
-175
lines changed

4 files changed

+12
-175
lines changed

Doc/library/hashlib.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,6 @@ include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_.
280280
factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB).
281281
*dklen* is the length of the derived key.
282282

283-
.. availability:: OpenSSL 1.1+.
284-
285283
.. versionadded:: 3.6
286284

287285

Doc/library/ssl.rst

Lines changed: 11 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ by SSL sockets created through the :meth:`SSLContext.wrap_socket` method.
5858
In the future the ssl module will require at least OpenSSL 1.0.2 or
5959
1.1.0.
6060

61+
.. versionchanged:: 3.10
62+
63+
:pep:`644` has been implemented. The ssl module requires OpenSSL 1.1.1
64+
or newer.
65+
6166

6267
Functions, Constants, and Exceptions
6368
------------------------------------
@@ -325,19 +330,6 @@ Random generation
325330
:func:`ssl.RAND_egd` and :func:`ssl.RAND_add` to increase the randomness of
326331
the pseudo-random number generator.
327332

328-
.. function:: RAND_egd(path)
329-
330-
If you are running an entropy-gathering daemon (EGD) somewhere, and *path*
331-
is the pathname of a socket connection open to it, this will read 256 bytes
332-
of randomness from the socket, and add it to the SSL pseudo-random number
333-
generator to increase the security of generated secret keys. This is
334-
typically only necessary on systems without better sources of randomness.
335-
336-
See http://egd.sourceforge.net/ or http://prngd.sourceforge.net/ for sources
337-
of entropy-gathering daemons.
338-
339-
.. availability:: not available with LibreSSL and OpenSSL > 1.1.0.
340-
341333
.. function:: RAND_add(bytes, entropy)
342334

343335
Mix the given *bytes* into the SSL pseudo-random number generator. The
@@ -879,8 +871,6 @@ Constants
879871
Disable compression on the SSL channel. This is useful if the application
880872
protocol supports its own compression scheme.
881873

882-
This option is only available with OpenSSL 1.0.0 and later.
883-
884874
.. versionadded:: 3.3
885875

886876
.. class:: Options
@@ -1593,25 +1583,7 @@ to speed up repeated connections from the same clients.
15931583

15941584
>>> ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
15951585
>>> ctx.set_ciphers('ECDHE+AESGCM:!ECDSA')
1596-
>>> ctx.get_ciphers() # OpenSSL 1.0.x
1597-
[{'alg_bits': 256,
1598-
'description': 'ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA '
1599-
'Enc=AESGCM(256) Mac=AEAD',
1600-
'id': 50380848,
1601-
'name': 'ECDHE-RSA-AES256-GCM-SHA384',
1602-
'protocol': 'TLSv1/SSLv3',
1603-
'strength_bits': 256},
1604-
{'alg_bits': 128,
1605-
'description': 'ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=RSA '
1606-
'Enc=AESGCM(128) Mac=AEAD',
1607-
'id': 50380847,
1608-
'name': 'ECDHE-RSA-AES128-GCM-SHA256',
1609-
'protocol': 'TLSv1/SSLv3',
1610-
'strength_bits': 128}]
1611-
1612-
On OpenSSL 1.1 and newer the cipher dict contains additional fields::
1613-
1614-
>>> ctx.get_ciphers() # OpenSSL 1.1+
1586+
>>> ctx.get_ciphers()
16151587
[{'aead': True,
16161588
'alg_bits': 256,
16171589
'auth': 'auth-rsa',
@@ -1637,8 +1609,6 @@ to speed up repeated connections from the same clients.
16371609
'strength_bits': 128,
16381610
'symmetric': 'aes-128-gcm'}]
16391611

1640-
.. availability:: OpenSSL 1.0.2+.
1641-
16421612
.. versionadded:: 3.6
16431613

16441614
.. method:: SSLContext.set_default_verify_paths()
@@ -1663,8 +1633,8 @@ to speed up repeated connections from the same clients.
16631633
when connected, the :meth:`SSLSocket.cipher` method of SSL sockets will
16641634
give the currently selected cipher.
16651635

1666-
OpenSSL 1.1.1 has TLS 1.3 cipher suites enabled by default. The suites
1667-
cannot be disabled with :meth:`~SSLContext.set_ciphers`.
1636+
TLS 1.3 cipher suites cannot be disabled with
1637+
:meth:`~SSLContext.set_ciphers`.
16681638

16691639
.. method:: SSLContext.set_alpn_protocols(protocols)
16701640

@@ -1678,10 +1648,6 @@ to speed up repeated connections from the same clients.
16781648
This method will raise :exc:`NotImplementedError` if :data:`HAS_ALPN` is
16791649
``False``.
16801650

1681-
OpenSSL 1.1.0 to 1.1.0e will abort the handshake and raise :exc:`SSLError`
1682-
when both sides support ALPN but cannot agree on a protocol. 1.1.0f+
1683-
behaves like 1.0.2, :meth:`SSLSocket.selected_alpn_protocol` returns None.
1684-
16851651
.. versionadded:: 3.5
16861652

16871653
.. method:: SSLContext.set_npn_protocols(protocols)
@@ -1883,7 +1849,7 @@ to speed up repeated connections from the same clients.
18831849
.. method:: SSLContext.session_stats()
18841850

18851851
Get statistics about the SSL sessions created or managed by this context.
1886-
A dictionary is returned which maps the names of each `piece of information <https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_sess_number.html>`_ to their
1852+
A dictionary is returned which maps the names of each `piece of information <https://www.openssl.org/docs/man1.1.1/ssl/SSL_CTX_sess_number.html>`_ to their
18871853
numeric values. For example, here is the total number of hits and misses
18881854
in the session cache since the context was created::
18891855

@@ -1926,10 +1892,6 @@ to speed up repeated connections from the same clients.
19261892
:attr:`~SSLContext.verify_mode` is :data:`CERT_NONE`. Previously
19271893
the same operation would have failed with a :exc:`ValueError`.
19281894

1929-
.. note::
1930-
1931-
This features requires OpenSSL 0.9.8f or newer.
1932-
19331895
.. attribute:: SSLContext.keylog_filename
19341896

19351897
Write TLS keys to a keylog file, whenever key material is generated or
@@ -1940,10 +1902,6 @@ to speed up repeated connections from the same clients.
19401902

19411903
.. versionadded:: 3.8
19421904

1943-
.. note::
1944-
1945-
This features requires OpenSSL 1.1.1 or newer.
1946-
19471905
.. attribute:: SSLContext.maximum_version
19481906

19491907
A :class:`TLSVersion` enum member representing the highest supported
@@ -1960,23 +1918,13 @@ to speed up repeated connections from the same clients.
19601918
:attr:`~SSLContext.maximum_version` set to :attr:`TLSVersion.TLSv1_2`
19611919
will not be able to establish a TLS 1.2 connection.
19621920

1963-
.. note::
1964-
1965-
This attribute is not available unless the ssl module is compiled
1966-
with OpenSSL 1.1.0g or newer.
1967-
19681921
.. versionadded:: 3.7
19691922

19701923
.. attribute:: SSLContext.minimum_version
19711924

19721925
Like :attr:`SSLContext.maximum_version` except it is the lowest
19731926
supported version or :attr:`TLSVersion.MINIMUM_SUPPORTED`.
19741927

1975-
.. note::
1976-
1977-
This attribute is not available unless the ssl module is compiled
1978-
with OpenSSL 1.1.0g or newer.
1979-
19801928
.. versionadded:: 3.7
19811929

19821930
.. attribute:: SSLContext.num_tickets
@@ -1985,11 +1933,6 @@ to speed up repeated connections from the same clients.
19851933
:attr:`TLS_PROTOCOL_SERVER` context. The setting has no impact on TLS
19861934
1.0 to 1.2 connections.
19871935

1988-
.. note::
1989-
1990-
This attribute is not available unless the ssl module is compiled
1991-
with OpenSSL 1.1.1 or newer.
1992-
19931936
.. versionadded:: 3.8
19941937

19951938
.. attribute:: SSLContext.options
@@ -1998,11 +1941,6 @@ to speed up repeated connections from the same clients.
19981941
The default value is :data:`OP_ALL`, but you can specify other options
19991942
such as :data:`OP_NO_SSLv2` by ORing them together.
20001943

2001-
.. note::
2002-
With versions of OpenSSL older than 0.9.8m, it is only possible
2003-
to set options, not to clear them. Attempting to clear an option
2004-
(by resetting the corresponding bits) will raise a :exc:`ValueError`.
2005-
20061944
.. versionchanged:: 3.6
20071945
:attr:`SSLContext.options` returns :class:`Options` flags:
20081946

@@ -2025,10 +1963,6 @@ to speed up repeated connections from the same clients.
20251963
:meth:`SSLSocket.verify_client_post_handshake` is called and some I/O is
20261964
performed.
20271965

2028-
.. note::
2029-
Only available with OpenSSL 1.1.1 and TLS 1.3 enabled. Without TLS 1.3
2030-
support, the property value is None and can't be modified
2031-
20321966
.. versionadded:: 3.8
20331967

20341968
.. attribute:: SSLContext.protocol
@@ -2042,9 +1976,6 @@ to speed up repeated connections from the same clients.
20421976
subject common name in the absence of a subject alternative name
20431977
extension (default: true).
20441978

2045-
.. note::
2046-
Only writeable with OpenSSL 1.1.0 or higher.
2047-
20481979
.. versionadded:: 3.7
20491980

20501981
.. versionchanged:: 3.10
@@ -2058,16 +1989,13 @@ to speed up repeated connections from the same clients.
20581989
<https://www.openssl.org/docs/manmaster/man3/SSL_CTX_get_security_level.html>`_
20591990
for the context. This attribute is read-only.
20601991

2061-
.. availability:: OpenSSL 1.1.0 or newer
2062-
20631992
.. versionadded:: 3.10
20641993

20651994
.. attribute:: SSLContext.verify_flags
20661995

20671996
The flags for certificate verification operations. You can set flags like
20681997
:data:`VERIFY_CRL_CHECK_LEAF` by ORing them together. By default OpenSSL
20691998
does neither require nor verify certificate revocation lists (CRLs).
2070-
Available only with openssl version 0.9.8+.
20711999

20722000
.. versionadded:: 3.4
20732001

@@ -2733,9 +2661,8 @@ TLS 1.3
27332661

27342662
.. versionadded:: 3.7
27352663

2736-
Python has provisional and experimental support for TLS 1.3 with OpenSSL
2737-
1.1.1. The new protocol behaves slightly differently than previous version
2738-
of TLS/SSL. Some new TLS 1.3 features are not yet available.
2664+
The TLS 1.3 protocol behaves slightly differently than previous version
2665+
of TLS/SSL. Some new TLS 1.3 features are not yet available.
27392666

27402667
- TLS 1.3 uses a disjunct set of cipher suites. All AES-GCM and
27412668
ChaCha20 cipher suites are enabled by default. The method
@@ -2752,23 +2679,6 @@ of TLS/SSL. Some new TLS 1.3 features are not yet available.
27522679
signature algorithm configuration, and rekeying are not supported yet.
27532680

27542681

2755-
.. _ssl-libressl:
2756-
2757-
LibreSSL support
2758-
----------------
2759-
2760-
LibreSSL is a fork of OpenSSL 1.0.1. The ssl module has limited support for
2761-
LibreSSL. Some features are not available when the ssl module is compiled
2762-
with LibreSSL.
2763-
2764-
* LibreSSL >= 2.6.1 no longer supports NPN. The methods
2765-
:meth:`SSLContext.set_npn_protocols` and
2766-
:meth:`SSLSocket.selected_npn_protocol` are not available.
2767-
* :meth:`SSLContext.set_default_verify_paths` ignores the env vars
2768-
:envvar:`SSL_CERT_FILE` and :envvar:`SSL_CERT_PATH` although
2769-
:func:`get_default_verify_paths` still reports them.
2770-
2771-
27722682
.. seealso::
27732683

27742684
Class :class:`socket.socket`

Modules/_ssl.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4971,38 +4971,6 @@ _ssl_RAND_status_impl(PyObject *module)
49714971
return PyLong_FromLong(RAND_status());
49724972
}
49734973

4974-
#ifndef OPENSSL_NO_EGD
4975-
/* LCOV_EXCL_START */
4976-
/*[clinic input]
4977-
_ssl.RAND_egd
4978-
path: object(converter="PyUnicode_FSConverter")
4979-
/
4980-
4981-
Queries the entropy gather daemon (EGD) on the socket named by 'path'.
4982-
4983-
Returns number of bytes read. Raises SSLError if connection to EGD
4984-
fails or if it does not provide enough data to seed PRNG.
4985-
[clinic start generated code]*/
4986-
4987-
static PyObject *
4988-
_ssl_RAND_egd_impl(PyObject *module, PyObject *path)
4989-
/*[clinic end generated code: output=02a67c7c367f52fa input=1aeb7eb948312195]*/
4990-
{
4991-
int bytes = RAND_egd(PyBytes_AsString(path));
4992-
Py_DECREF(path);
4993-
if (bytes == -1) {
4994-
PyErr_SetString(PySSLErrorObject,
4995-
"EGD connection failed or EGD did not return "
4996-
"enough data to seed the PRNG");
4997-
return NULL;
4998-
}
4999-
return PyLong_FromLong(bytes);
5000-
}
5001-
/* LCOV_EXCL_STOP */
5002-
#endif /* OPENSSL_NO_EGD */
5003-
5004-
5005-
50064974
/*[clinic input]
50074975
_ssl.get_default_verify_paths
50084976
@@ -5445,7 +5413,6 @@ static PyMethodDef PySSL_methods[] = {
54455413
_SSL_RAND_ADD_METHODDEF
54465414
_SSL_RAND_BYTES_METHODDEF
54475415
_SSL_RAND_PSEUDO_BYTES_METHODDEF
5448-
_SSL_RAND_EGD_METHODDEF
54495416
_SSL_RAND_STATUS_METHODDEF
54505417
_SSL_GET_DEFAULT_VERIFY_PATHS_METHODDEF
54515418
_SSL_ENUM_CERTIFICATES_METHODDEF

Modules/clinic/_ssl.c.h

Lines changed: 1 addition & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)