Skip to content
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

cadata param can (and PEM-encoded cadata must) be unicode under PY2 #3150

Merged
merged 4 commits into from Aug 23, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 21 additions & 27 deletions stdlib/2and3/ssl.pyi
@@ -1,7 +1,8 @@
# Stubs for ssl

from typing import (
Any, Callable, ClassVar, Dict, List, NamedTuple, Optional, Set, Tuple, Union,
Any, Callable, ClassVar, Dict, List, NamedTuple, Optional, Set, Text, Tuple,
Union,
)
import enum
import socket
Expand Down Expand Up @@ -48,23 +49,21 @@ def wrap_socket(sock: socket.socket, keyfile: Optional[str] = ...,
ciphers: Optional[str] = ...) -> SSLSocket: ...


if sys.version_info < (3,) or sys.version_info >= (3, 4):
sfreilich marked this conversation as resolved.
Show resolved Hide resolved
def create_default_context(purpose: Any = ..., *,
def create_default_context(purpose: Any = ..., *,
cafile: Optional[str] = ...,
capath: Optional[str] = ...,
cadata: Union[Text, bytes, None] = ...) -> SSLContext: ...

def _create_unverified_context(protocol: int = ..., *,
cert_reqs: int = ...,
check_hostname: bool = ...,
purpose: Any = ...,
certfile: Optional[str] = ...,
keyfile: Optional[str] = ...,
cafile: Optional[str] = ...,
capath: Optional[str] = ...,
cadata: Union[str, bytes, None] = ...) -> SSLContext: ...

if sys.version_info >= (3, 4):
def _create_unverified_context(protocol: int = ..., *,
cert_reqs: int = ...,
check_hostname: bool = ...,
purpose: Any = ...,
certfile: Optional[str] = ...,
keyfile: Optional[str] = ...,
cafile: Optional[str] = ...,
capath: Optional[str] = ...,
cadata: Union[str, bytes, None] = ...) -> SSLContext: ...
_create_default_https_context: Callable[..., SSLContext]
cadata: Union[Text, bytes, None] = ...) -> SSLContext: ...
_create_default_https_context: Callable[..., SSLContext]

if sys.version_info >= (3, 3):
def RAND_bytes(num: int) -> bytes: ...
Expand Down Expand Up @@ -239,17 +238,12 @@ class SSLContext:
def cert_store_stats(self) -> Dict[str, int]: ...
def load_cert_chain(self, certfile: str, keyfile: Optional[str] = ...,
password: _PasswordType = ...) -> None: ...
if sys.version_info < (3,) or sys.version_info >= (3, 4):
def load_default_certs(self, purpose: Purpose = ...) -> None: ...
def load_verify_locations(self, cafile: Optional[str] = ...,
capath: Optional[str] = ...,
cadata: Union[str, bytes, None] = ...) -> None: ...
def get_ca_certs(self,
binary_form: bool = ...) -> Union[List[_PeerCertRetDictType], List[bytes]]: ...
else:
def load_verify_locations(self,
cafile: Optional[str] = ...,
capath: Optional[str] = ...) -> None: ...
def load_default_certs(self, purpose: Purpose = ...) -> None: ...
def load_verify_locations(self, cafile: Optional[str] = ...,
capath: Optional[str] = ...,
cadata: Union[Text, bytes, None] = ...) -> None: ...
def get_ca_certs(self,
binary_form: bool = ...) -> Union[List[_PeerCertRetDictType], List[bytes]]: ...
def set_default_verify_paths(self) -> None: ...
def set_ciphers(self, ciphers: str) -> None: ...
if sys.version_info < (3,) or sys.version_info >= (3, 5):
Expand Down