Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions Doc/library/ssl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ Constants
Selects SSL version 3 as the channel encryption protocol.

This protocol is not available if OpenSSL is compiled with the
``no-ssl3`` option.
``no-ssl3`` option, or if Python is built with OpenSSL 4.0 or later.

.. warning::

Expand All @@ -702,31 +702,47 @@ Constants

Selects TLS version 1.0 as the channel encryption protocol.

This constant is not available if Python is built with
OpenSSL 4.0 or later.

.. deprecated:: 3.6

OpenSSL has deprecated all version specific protocols.
OpenSSL has deprecated all version specific protocols. Use the default
protocol :data:`PROTOCOL_TLS_SERVER` or :data:`PROTOCOL_TLS_CLIENT`
with :attr:`SSLContext.minimum_version` and
:attr:`SSLContext.maximum_version` instead.

.. data:: PROTOCOL_TLSv1_1

Selects TLS version 1.1 as the channel encryption protocol.
Available only with openssl version 1.0.1+.

This constant is not available if Python is built with
OpenSSL 4.0 or later.

.. versionadded:: 3.4

.. deprecated:: 3.6

OpenSSL has deprecated all version specific protocols.
OpenSSL has deprecated all version specific protocols. Use the default
protocol :data:`PROTOCOL_TLS_SERVER` or :data:`PROTOCOL_TLS_CLIENT`
with :attr:`SSLContext.minimum_version` and
:attr:`SSLContext.maximum_version` instead.

.. data:: PROTOCOL_TLSv1_2

Selects TLS version 1.2 as the channel encryption protocol.
Available only with openssl version 1.0.1+.

This constant is not available if Python is built with
OpenSSL 4.0 or later.

.. versionadded:: 3.4

.. deprecated:: 3.6

OpenSSL has deprecated all version specific protocols.
OpenSSL has deprecated all version specific protocols. Use the default
protocol :data:`PROTOCOL_TLS_SERVER` or :data:`PROTOCOL_TLS_CLIENT`
with :attr:`SSLContext.minimum_version` and
:attr:`SSLContext.maximum_version` instead.

.. data:: OP_ALL

Expand Down Expand Up @@ -2365,7 +2381,7 @@ to speed up repeated connections from the same clients.

import socket, ssl

context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
context.verify_mode = ssl.CERT_REQUIRED
context.check_hostname = True
context.load_default_certs()
Expand Down
4 changes: 3 additions & 1 deletion Lib/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@

The following constants identify various SSL protocol variants:

PROTOCOL_SSLv2
PROTOCOL_SSLv3
PROTOCOL_SSLv23
PROTOCOL_TLS
Expand All @@ -62,6 +61,9 @@
PROTOCOL_TLSv1_1
PROTOCOL_TLSv1_2

PROTOCOL_SSLv3, PROTOCOL_TLSv1, PROTOCOL_TLSv1_1 and PROTOCOL_TLSv1_2 are
deprecated, and are not available if Python is built with OpenSSL 4.0 or later.

The following constants identify various SSL alert message descriptions as per
http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6

Expand Down
Loading