@@ -93,46 +93,6 @@ if sys.version_info < (3, 12):
93
93
suppress_ragged_eofs : bool = True ,
94
94
ciphers : str | None = None ,
95
95
) -> SSLSocket : ...
96
-
97
- def create_default_context (
98
- purpose : Purpose = ...,
99
- * ,
100
- cafile : StrOrBytesPath | None = None ,
101
- capath : StrOrBytesPath | None = None ,
102
- cadata : str | ReadableBuffer | None = None ,
103
- ) -> SSLContext : ...
104
-
105
- if sys .version_info >= (3 , 10 ):
106
- def _create_unverified_context (
107
- protocol : int | None = None ,
108
- * ,
109
- cert_reqs : int = ...,
110
- check_hostname : bool = False ,
111
- purpose : Purpose = ...,
112
- certfile : StrOrBytesPath | None = None ,
113
- keyfile : StrOrBytesPath | None = None ,
114
- cafile : StrOrBytesPath | None = None ,
115
- capath : StrOrBytesPath | None = None ,
116
- cadata : str | ReadableBuffer | None = None ,
117
- ) -> SSLContext : ...
118
-
119
- else :
120
- def _create_unverified_context (
121
- protocol : int = ...,
122
- * ,
123
- cert_reqs : int = ...,
124
- check_hostname : bool = False ,
125
- purpose : Purpose = ...,
126
- certfile : StrOrBytesPath | None = None ,
127
- keyfile : StrOrBytesPath | None = None ,
128
- cafile : StrOrBytesPath | None = None ,
129
- capath : StrOrBytesPath | None = None ,
130
- cadata : str | ReadableBuffer | None = None ,
131
- ) -> SSLContext : ...
132
-
133
- _create_default_https_context : Callable [..., SSLContext ]
134
-
135
- if sys .version_info < (3 , 12 ):
136
96
@deprecated ("Deprecated since Python 3.7. Removed in Python 3.12." )
137
97
def match_hostname (cert : _PeerCertRetDictType , hostname : str ) -> None : ...
138
98
@@ -372,7 +332,7 @@ class SSLSocket(socket.socket):
372
332
def get_channel_binding (self , cb_type : str = "tls-unique" ) -> bytes | None : ...
373
333
def selected_alpn_protocol (self ) -> str | None : ...
374
334
if sys .version_info >= (3 , 10 ):
375
- @deprecated ("Deprecated in 3.10. Use ALPN instead." )
335
+ @deprecated ("Deprecated since Python 3.10. Use ALPN instead." )
376
336
def selected_npn_protocol (self ) -> str | None : ...
377
337
else :
378
338
def selected_npn_protocol (self ) -> str | None : ...
@@ -426,7 +386,7 @@ class SSLContext(_SSLContext):
426
386
else :
427
387
def __new__ (cls , protocol : int = ..., * args : Any , ** kwargs : Any ) -> Self : ...
428
388
429
- def load_default_certs (self , purpose : Purpose = ... ) -> None : ...
389
+ def load_default_certs (self , purpose : Purpose = Purpose . SERVER_AUTH ) -> None : ...
430
390
def load_verify_locations (
431
391
self ,
432
392
cafile : StrOrBytesPath | None = None ,
@@ -444,7 +404,7 @@ class SSLContext(_SSLContext):
444
404
def set_ciphers (self , cipherlist : str , / ) -> None : ...
445
405
def set_alpn_protocols (self , alpn_protocols : Iterable [str ]) -> None : ...
446
406
if sys .version_info >= (3 , 10 ):
447
- @deprecated ("Deprecated in 3.10. Use ALPN instead." )
407
+ @deprecated ("Deprecated since Python 3.10. Use ALPN instead." )
448
408
def set_npn_protocols (self , npn_protocols : Iterable [str ]) -> None : ...
449
409
else :
450
410
def set_npn_protocols (self , npn_protocols : Iterable [str ]) -> None : ...
@@ -470,6 +430,44 @@ class SSLContext(_SSLContext):
470
430
session : SSLSession | None = None ,
471
431
) -> SSLObject : ...
472
432
433
+ def create_default_context (
434
+ purpose : Purpose = Purpose .SERVER_AUTH ,
435
+ * ,
436
+ cafile : StrOrBytesPath | None = None ,
437
+ capath : StrOrBytesPath | None = None ,
438
+ cadata : str | ReadableBuffer | None = None ,
439
+ ) -> SSLContext : ...
440
+
441
+ if sys .version_info >= (3 , 10 ):
442
+ def _create_unverified_context (
443
+ protocol : int | None = None ,
444
+ * ,
445
+ cert_reqs : int = ...,
446
+ check_hostname : bool = False ,
447
+ purpose : Purpose = Purpose .SERVER_AUTH ,
448
+ certfile : StrOrBytesPath | None = None ,
449
+ keyfile : StrOrBytesPath | None = None ,
450
+ cafile : StrOrBytesPath | None = None ,
451
+ capath : StrOrBytesPath | None = None ,
452
+ cadata : str | ReadableBuffer | None = None ,
453
+ ) -> SSLContext : ...
454
+
455
+ else :
456
+ def _create_unverified_context (
457
+ protocol : int = ...,
458
+ * ,
459
+ cert_reqs : int = ...,
460
+ check_hostname : bool = False ,
461
+ purpose : Purpose = Purpose .SERVER_AUTH ,
462
+ certfile : StrOrBytesPath | None = None ,
463
+ keyfile : StrOrBytesPath | None = None ,
464
+ cafile : StrOrBytesPath | None = None ,
465
+ capath : StrOrBytesPath | None = None ,
466
+ cadata : str | ReadableBuffer | None = None ,
467
+ ) -> SSLContext : ...
468
+
469
+ _create_default_https_context = create_default_context
470
+
473
471
class SSLObject :
474
472
context : SSLContext
475
473
@property
@@ -490,7 +488,7 @@ class SSLObject:
490
488
def getpeercert (self , binary_form : bool ) -> _PeerCertRetType : ...
491
489
def selected_alpn_protocol (self ) -> str | None : ...
492
490
if sys .version_info >= (3 , 10 ):
493
- @deprecated ("Deprecated in 3.10. Use ALPN instead." )
491
+ @deprecated ("Deprecated since Python 3.10. Use ALPN instead." )
494
492
def selected_npn_protocol (self ) -> str | None : ...
495
493
else :
496
494
def selected_npn_protocol (self ) -> str | None : ...
0 commit comments