Skip to content

[ssl] Add missing default values #14472

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 1 commit into from
Jul 27, 2025
Merged
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
86 changes: 42 additions & 44 deletions stdlib/ssl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -93,46 +93,6 @@ if sys.version_info < (3, 12):
suppress_ragged_eofs: bool = True,
ciphers: str | None = None,
) -> SSLSocket: ...

def create_default_context(
purpose: Purpose = ...,
*,
cafile: StrOrBytesPath | None = None,
capath: StrOrBytesPath | None = None,
cadata: str | ReadableBuffer | None = None,
) -> SSLContext: ...

if sys.version_info >= (3, 10):
def _create_unverified_context(
protocol: int | None = None,
*,
cert_reqs: int = ...,
check_hostname: bool = False,
purpose: Purpose = ...,
certfile: StrOrBytesPath | None = None,
keyfile: StrOrBytesPath | None = None,
cafile: StrOrBytesPath | None = None,
capath: StrOrBytesPath | None = None,
cadata: str | ReadableBuffer | None = None,
) -> SSLContext: ...

else:
def _create_unverified_context(
protocol: int = ...,
*,
cert_reqs: int = ...,
check_hostname: bool = False,
purpose: Purpose = ...,
certfile: StrOrBytesPath | None = None,
keyfile: StrOrBytesPath | None = None,
cafile: StrOrBytesPath | None = None,
capath: StrOrBytesPath | None = None,
cadata: str | ReadableBuffer | None = None,
) -> SSLContext: ...

_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: ...

Expand Down Expand Up @@ -372,7 +332,7 @@ class SSLSocket(socket.socket):
def get_channel_binding(self, cb_type: str = "tls-unique") -> bytes | None: ...
def selected_alpn_protocol(self) -> str | None: ...
if sys.version_info >= (3, 10):
@deprecated("Deprecated in 3.10. Use ALPN instead.")
@deprecated("Deprecated since Python 3.10. Use ALPN instead.")
def selected_npn_protocol(self) -> str | None: ...
else:
def selected_npn_protocol(self) -> str | None: ...
Expand Down Expand Up @@ -426,7 +386,7 @@ class SSLContext(_SSLContext):
else:
def __new__(cls, protocol: int = ..., *args: Any, **kwargs: Any) -> Self: ...

def load_default_certs(self, purpose: Purpose = ...) -> None: ...
def load_default_certs(self, purpose: Purpose = Purpose.SERVER_AUTH) -> None: ...
def load_verify_locations(
self,
cafile: StrOrBytesPath | None = None,
Expand All @@ -444,7 +404,7 @@ class SSLContext(_SSLContext):
def set_ciphers(self, cipherlist: str, /) -> None: ...
def set_alpn_protocols(self, alpn_protocols: Iterable[str]) -> None: ...
if sys.version_info >= (3, 10):
@deprecated("Deprecated in 3.10. Use ALPN instead.")
@deprecated("Deprecated since Python 3.10. Use ALPN instead.")
def set_npn_protocols(self, npn_protocols: Iterable[str]) -> None: ...
else:
def set_npn_protocols(self, npn_protocols: Iterable[str]) -> None: ...
Expand All @@ -470,6 +430,44 @@ class SSLContext(_SSLContext):
session: SSLSession | None = None,
) -> SSLObject: ...

def create_default_context(
purpose: Purpose = Purpose.SERVER_AUTH,
*,
cafile: StrOrBytesPath | None = None,
capath: StrOrBytesPath | None = None,
cadata: str | ReadableBuffer | None = None,
) -> SSLContext: ...

if sys.version_info >= (3, 10):
def _create_unverified_context(
protocol: int | None = None,
*,
cert_reqs: int = ...,
check_hostname: bool = False,
purpose: Purpose = Purpose.SERVER_AUTH,
certfile: StrOrBytesPath | None = None,
keyfile: StrOrBytesPath | None = None,
cafile: StrOrBytesPath | None = None,
capath: StrOrBytesPath | None = None,
cadata: str | ReadableBuffer | None = None,
) -> SSLContext: ...

else:
def _create_unverified_context(
protocol: int = ...,
*,
cert_reqs: int = ...,
check_hostname: bool = False,
purpose: Purpose = Purpose.SERVER_AUTH,
certfile: StrOrBytesPath | None = None,
keyfile: StrOrBytesPath | None = None,
cafile: StrOrBytesPath | None = None,
capath: StrOrBytesPath | None = None,
cadata: str | ReadableBuffer | None = None,
) -> SSLContext: ...

_create_default_https_context = create_default_context

class SSLObject:
context: SSLContext
@property
Expand All @@ -490,7 +488,7 @@ class SSLObject:
def getpeercert(self, binary_form: bool) -> _PeerCertRetType: ...
def selected_alpn_protocol(self) -> str | None: ...
if sys.version_info >= (3, 10):
@deprecated("Deprecated in 3.10. Use ALPN instead.")
@deprecated("Deprecated since Python 3.10. Use ALPN instead.")
def selected_npn_protocol(self) -> str | None: ...
else:
def selected_npn_protocol(self) -> str | None: ...
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