Skip to content

Commit 8700993

Browse files
jaensJelleZijlstra
authored andcommitted
ssl: Add missing constants & classes (#1569)
* ssl: Add missing PROTOCOL_TLS & OP_NO_TICKET constants These were added in 3.5 and 3.6: https://docs.python.org/3.5/library/ssl.html#ssl.PROTOCOL_TLS https://docs.python.org/3.6/library/ssl.html#ssl.PROTOCOL_TLS_CLIENT * ssl: Add missing SSLSession class Reference: https://github.com/python/cpython/blob/5fe59f8e3a0a56a155c18f9d581205ec533764b6/Modules/_ssl.c#L4428
1 parent f1a13ce commit 8700993

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

stdlib/3/ssl.pyi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ PROTOCOL_TLSv1 = ... # type: int
102102
if sys.version_info >= (3, 4):
103103
PROTOCOL_TLSv1_1 = ... # type: int
104104
PROTOCOL_TLSv1_2 = ... # type: int
105+
if sys.version_info >= (3, 5):
106+
PROTOCOL_TLS = ... # type: int
107+
if sys.version_info >= (3, 6):
108+
PROTOCOL_TLS_CLIENT = ... # type: int
109+
PROTOCOL_TLS_SERVER = ... # type: int
105110

106111
OP_ALL = ... # type: int
107112
OP_NO_SSLv2 = ... # type: int
@@ -114,6 +119,8 @@ OP_CIPHER_SERVER_PREFERENCE = ... # type: int
114119
OP_SINGLE_DH_USE = ... # type: int
115120
OP_SINGLE_ECDH_USE = ... # type: int
116121
OP_NO_COMPRESSION = ... # type: int
122+
if sys.version_info >= (3, 6):
123+
OP_NO_TICKET = ... # type: int
117124

118125
if sys.version_info >= (3, 5):
119126
HAS_ALPN = ... # type: int
@@ -168,6 +175,10 @@ class SSLSocket(socket.socket):
168175
context = ... # type: SSLContext
169176
server_side = ... # type: bool
170177
server_hostname = ... # type: Optional[str]
178+
if sys.version_info >= (3, 6):
179+
session = ... # type: Optional[SSLSession]
180+
session_reused = ... # type: Optional[bool]
181+
171182
def read(self, len: int = ...,
172183
buffer: Optional[bytearray] = ...) -> bytes: ...
173184
def write(self, buf: bytes) -> int: ...
@@ -237,6 +248,9 @@ if sys.version_info >= (3, 5):
237248
context = ... # type: SSLContext
238249
server_side = ... # type: bool
239250
server_hostname = ... # type: Optional[str]
251+
if sys.version_info >= (3, 6):
252+
session = ... # type: Optional[SSLSession]
253+
session_reused = ... # type: bool
240254
def read(self, len: int = ...,
241255
buffer: Optional[bytearray] = ...) -> bytes: ...
242256
def write(self, buf: bytes) -> int: ...
@@ -257,6 +271,14 @@ if sys.version_info >= (3, 5):
257271
def write(self, buf: bytes) -> int: ...
258272
def write_eof(self) -> None: ...
259273

274+
if sys.version_info >= (3, 6):
275+
class SSLSession:
276+
id = ... # type: bytes
277+
time = ... # type: int
278+
timeout = ... # type: int
279+
ticket_lifetime_hint = ... # type: int
280+
has_ticket = ... # type: bool
281+
260282

261283
# TODO below documented in cpython but not in docs.python.org
262284
# taken from python 3.4

0 commit comments

Comments
 (0)