Skip to content

ssl: Add missing constants & classes #1569

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 2 commits into from
Aug 29, 2017
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
22 changes: 22 additions & 0 deletions stdlib/3/ssl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ PROTOCOL_TLSv1 = ... # type: int
if sys.version_info >= (3, 4):
PROTOCOL_TLSv1_1 = ... # type: int
PROTOCOL_TLSv1_2 = ... # type: int
if sys.version_info >= (3, 5):
PROTOCOL_TLS = ... # type: int
if sys.version_info >= (3, 6):
PROTOCOL_TLS_CLIENT = ... # type: int
PROTOCOL_TLS_SERVER = ... # type: int

OP_ALL = ... # type: int
OP_NO_SSLv2 = ... # type: int
Expand All @@ -114,6 +119,8 @@ OP_CIPHER_SERVER_PREFERENCE = ... # type: int
OP_SINGLE_DH_USE = ... # type: int
OP_SINGLE_ECDH_USE = ... # type: int
OP_NO_COMPRESSION = ... # type: int
if sys.version_info >= (3, 6):
OP_NO_TICKET = ... # type: int

if sys.version_info >= (3, 5):
HAS_ALPN = ... # type: int
Expand Down Expand Up @@ -168,6 +175,10 @@ class SSLSocket(socket.socket):
context = ... # type: SSLContext
server_side = ... # type: bool
server_hostname = ... # type: Optional[str]
if sys.version_info >= (3, 6):
session = ... # type: Optional[SSLSession]
session_reused = ... # type: Optional[bool]

def read(self, len: int = ...,
buffer: Optional[bytearray] = ...) -> bytes: ...
def write(self, buf: bytes) -> int: ...
Expand Down Expand Up @@ -237,6 +248,9 @@ if sys.version_info >= (3, 5):
context = ... # type: SSLContext
server_side = ... # type: bool
server_hostname = ... # type: Optional[str]
if sys.version_info >= (3, 6):
session = ... # type: Optional[SSLSession]
session_reused = ... # type: bool
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def read(self, len: int = ...,
buffer: Optional[bytearray] = ...) -> bytes: ...
def write(self, buf: bytes) -> int: ...
Expand All @@ -257,6 +271,14 @@ if sys.version_info >= (3, 5):
def write(self, buf: bytes) -> int: ...
def write_eof(self) -> None: ...

if sys.version_info >= (3, 6):
class SSLSession:
id = ... # type: bytes
time = ... # type: int
timeout = ... # type: int
ticket_lifetime_hint = ... # type: int
has_ticket = ... # type: bool


# TODO below documented in cpython but not in docs.python.org
# taken from python 3.4
Expand Down