Skip to content

[ssl] Deprecate several features #14432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 26, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Correct deprecated versions
  • Loading branch information
donBarbos committed Jul 20, 2025
commit 1c091cb3eea5c7e1b77c5ffa294dac1853321b7f
49 changes: 16 additions & 33 deletions stdlib/ssl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,19 @@ class SSLCertVerificationError(SSLError, ValueError):
CertificateError = SSLCertVerificationError

if sys.version_info < (3, 12):
if sys.version_info >= (3, 10):
@deprecated("Deprecated in Python 3.9; Removed in 3.12.")
def wrap_socket(
sock: socket.socket,
keyfile: StrOrBytesPath | None = None,
certfile: StrOrBytesPath | None = None,
server_side: bool = False,
cert_reqs: int = ...,
ssl_version: int = ...,
ca_certs: str | None = None,
do_handshake_on_connect: bool = True,
suppress_ragged_eofs: bool = True,
ciphers: str | None = None,
) -> SSLSocket: ...
else:
def wrap_socket(
sock: socket.socket,
keyfile: StrOrBytesPath | None = None,
certfile: StrOrBytesPath | None = None,
server_side: bool = False,
cert_reqs: int = ...,
ssl_version: int = ...,
ca_certs: str | None = None,
do_handshake_on_connect: bool = True,
suppress_ragged_eofs: bool = True,
ciphers: str | None = None,
) -> SSLSocket: ...
@deprecated("Deprecated since Python 3.7; Removed in Python 3.12.")
def wrap_socket(
sock: socket.socket,
keyfile: StrOrBytesPath | None = None,
certfile: StrOrBytesPath | None = None,
server_side: bool = False,
cert_reqs: int = ...,
ssl_version: int = ...,
ca_certs: str | None = None,
do_handshake_on_connect: bool = True,
suppress_ragged_eofs: bool = True,
ciphers: str | None = None,
) -> SSLSocket: ...

def create_default_context(
purpose: Purpose = ...,
Expand Down Expand Up @@ -147,11 +133,8 @@ else:
_create_default_https_context: Callable[..., SSLContext]

if sys.version_info < (3, 12):
if sys.version_info >= (3, 10):
@deprecated("Deprecated in Python 3.9; Removed in 3.12.")
def match_hostname(cert: _PeerCertRetDictType, hostname: str) -> None: ...
else:
def match_hostname(cert: _PeerCertRetDictType, hostname: str) -> None: ...
@deprecated("Deprecated since Python 3.7; Removed in Python 3.12.")
def match_hostname(cert: _PeerCertRetDictType, hostname: str) -> None: ...

def cert_time_to_seconds(cert_time: str) -> int: ...

Expand Down Expand Up @@ -438,7 +421,7 @@ class SSLContext(_SSLContext):
@overload
def __new__(cls, protocol: int, *args: Any, **kwargs: Any) -> Self: ...
@overload
@deprecated("ssl.SSLContext() without protocol argument is deprecated.")
@deprecated("Deprecated since Python 3.10; Use a specific version of the SSL protocol.")
def __new__(cls, protocol: None = None, *args: Any, **kwargs: Any) -> Self: ...
else:
def __new__(cls, protocol: int = ..., *args: Any, **kwargs: Any) -> Self: ...
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy