Skip to content

TLSv1.3 should be among possible return values of ssl.SSLSocket.version #154727

Description

@mimi89999

Documentation

Currently the https://docs.python.org/3.15/library/ssl.html#ssl.SSLSocket.version doc states:

Return the actual SSL protocol version negotiated by the connection as a string, or None if no secure connection is established. As of this writing, possible return values include "SSLv2", "SSLv3", "TLSv1", "TLSv1.1" and "TLSv1.2". Recent OpenSSL versions may define more return values.

I got TLSv1.3:

>>> import socket
... import ssl
... 
... hostname = 'lebihan.pl'
... context = ssl.create_default_context()
... 
... with socket.create_connection((hostname, 443)) as sock:
...     with context.wrap_socket(sock, server_hostname=hostname) as ssock:
...         print(ssock.version())
...         
TLSv1.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirtopic-SSL

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions