@@ -80,6 +80,7 @@ class SSLCertVerificationError(SSLError, ValueError):
80
80
CertificateError = SSLCertVerificationError
81
81
82
82
if sys .version_info < (3 , 12 ):
83
+ @deprecated ("Deprecated since Python 3.7. Removed in Python 3.12. Use `SSLContext.wrap_socket()` instead." )
83
84
def wrap_socket (
84
85
sock : socket .socket ,
85
86
keyfile : StrOrBytesPath | None = None ,
@@ -132,6 +133,7 @@ else:
132
133
_create_default_https_context : Callable [..., SSLContext ]
133
134
134
135
if sys .version_info < (3 , 12 ):
136
+ @deprecated ("Deprecated since Python 3.7. Removed in Python 3.12." )
135
137
def match_hostname (cert : _PeerCertRetDictType , hostname : str ) -> None : ...
136
138
137
139
def cert_time_to_seconds (cert_time : str ) -> int : ...
@@ -416,9 +418,11 @@ class SSLContext(_SSLContext):
416
418
if sys .version_info >= (3 , 10 ):
417
419
security_level : int
418
420
if sys .version_info >= (3 , 10 ):
419
- # Using the default (None) for the `protocol` parameter is deprecated,
420
- # but there isn't a good way of marking that in the stub unless/until PEP 702 is accepted
421
- def __new__ (cls , protocol : int | None = None , * args : Any , ** kwargs : Any ) -> Self : ...
421
+ @overload
422
+ def __new__ (cls , protocol : int , * args : Any , ** kwargs : Any ) -> Self : ...
423
+ @overload
424
+ @deprecated ("Deprecated since Python 3.10. Use a specific version of the SSL protocol." )
425
+ def __new__ (cls , protocol : None = None , * args : Any , ** kwargs : Any ) -> Self : ...
422
426
else :
423
427
def __new__ (cls , protocol : int = ..., * args : Any , ** kwargs : Any ) -> Self : ...
424
428
0 commit comments