mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
[ssl] Deprecate several features (#14432)
This commit is contained in:
+7
-3
@@ -80,6 +80,7 @@ class SSLCertVerificationError(SSLError, ValueError):
|
||||
CertificateError = SSLCertVerificationError
|
||||
|
||||
if sys.version_info < (3, 12):
|
||||
@deprecated("Deprecated since Python 3.7. Removed in Python 3.12. Use `SSLContext.wrap_socket()` instead.")
|
||||
def wrap_socket(
|
||||
sock: socket.socket,
|
||||
keyfile: StrOrBytesPath | None = None,
|
||||
@@ -132,6 +133,7 @@ else:
|
||||
_create_default_https_context: Callable[..., SSLContext]
|
||||
|
||||
if sys.version_info < (3, 12):
|
||||
@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: ...
|
||||
@@ -416,9 +418,11 @@ class SSLContext(_SSLContext):
|
||||
if sys.version_info >= (3, 10):
|
||||
security_level: int
|
||||
if sys.version_info >= (3, 10):
|
||||
# Using the default (None) for the `protocol` parameter is deprecated,
|
||||
# but there isn't a good way of marking that in the stub unless/until PEP 702 is accepted
|
||||
def __new__(cls, protocol: int | None = None, *args: Any, **kwargs: Any) -> Self: ...
|
||||
@overload
|
||||
def __new__(cls, protocol: int, *args: Any, **kwargs: Any) -> Self: ...
|
||||
@overload
|
||||
@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: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user