@@ -44,18 +44,20 @@ class SSLCertVerificationError(SSLError, ValueError):
44
44
45
45
CertificateError = SSLCertVerificationError
46
46
47
- def wrap_socket (
48
- sock : socket .socket ,
49
- keyfile : StrOrBytesPath | None = None ,
50
- certfile : StrOrBytesPath | None = None ,
51
- server_side : bool = False ,
52
- cert_reqs : int = ...,
53
- ssl_version : int = ...,
54
- ca_certs : str | None = None ,
55
- do_handshake_on_connect : bool = True ,
56
- suppress_ragged_eofs : bool = True ,
57
- ciphers : str | None = None ,
58
- ) -> SSLSocket : ...
47
+ if sys .version_info < (3 , 12 ):
48
+ def wrap_socket (
49
+ sock : socket .socket ,
50
+ keyfile : StrOrBytesPath | None = None ,
51
+ certfile : StrOrBytesPath | None = None ,
52
+ server_side : bool = False ,
53
+ cert_reqs : int = ...,
54
+ ssl_version : int = ...,
55
+ ca_certs : str | None = None ,
56
+ do_handshake_on_connect : bool = True ,
57
+ suppress_ragged_eofs : bool = True ,
58
+ ciphers : str | None = None ,
59
+ ) -> SSLSocket : ...
60
+
59
61
def create_default_context (
60
62
purpose : Purpose = ...,
61
63
* ,
95
97
_create_default_https_context : Callable [..., SSLContext ]
96
98
97
99
def RAND_bytes (__n : int ) -> bytes : ...
98
- def RAND_pseudo_bytes (__n : int ) -> tuple [bytes , bool ]: ...
100
+
101
+ if sys .version_info < (3 , 12 ):
102
+ def RAND_pseudo_bytes (__n : int ) -> tuple [bytes , bool ]: ...
103
+
99
104
def RAND_status () -> bool : ...
100
105
def RAND_egd (path : str ) -> None : ...
101
106
def RAND_add (__string : str | ReadableBuffer , __entropy : float ) -> None : ...
@@ -198,6 +203,11 @@ class Options(enum.IntFlag):
198
203
OP_ENABLE_MIDDLEBOX_COMPAT : int
199
204
if sys .platform == "linux" :
200
205
OP_IGNORE_UNEXPECTED_EOF : int
206
+ if sys .version_info >= (3 , 12 ):
207
+ OP_LEGACY_SERVER_CONNECT : int
208
+ if sys .version_info >= (3 , 12 ) and sys .platform != "linux" :
209
+ OP_ENABLE_KTLS : int
210
+ OP_IGNORE_UNEXPECTED_EOF : int
201
211
202
212
OP_ALL : Options
203
213
OP_NO_SSLv2 : Options
@@ -216,6 +226,11 @@ if sys.version_info >= (3, 8):
216
226
OP_ENABLE_MIDDLEBOX_COMPAT : Options
217
227
if sys .platform == "linux" :
218
228
OP_IGNORE_UNEXPECTED_EOF : Options
229
+ if sys .version_info >= (3 , 12 ):
230
+ OP_LEGACY_SERVER_CONNECT : Options
231
+ if sys .version_info >= (3 , 12 ) and sys .platform != "linux" :
232
+ OP_ENABLE_KTLS : Options
233
+ OP_IGNORE_UNEXPECTED_EOF : Options
219
234
220
235
HAS_NEVER_CHECK_COMMON_NAME : bool
221
236
HAS_SSLv2 : bool
0 commit comments