19
19
import weakref
20
20
import platform
21
21
import sysconfig
22
+ import functools
22
23
try :
23
24
import ctypes
24
25
except ImportError :
@@ -146,6 +147,85 @@ def data_file(*name):
146
147
OP_ENABLE_MIDDLEBOX_COMPAT = getattr (ssl , "OP_ENABLE_MIDDLEBOX_COMPAT" , 0 )
147
148
148
149
150
+ def has_tls_protocol (protocol ):
151
+ """Check if a TLS protocol is available and enabled
152
+
153
+ :param protocol: enum ssl._SSLMethod member or name
154
+ :return: bool
155
+ """
156
+ if isinstance (protocol , str ):
157
+ assert protocol .startswith ('PROTOCOL_' )
158
+ protocol = getattr (ssl , protocol , None )
159
+ if protocol is None :
160
+ return False
161
+ if protocol in {
162
+ ssl .PROTOCOL_TLS , ssl .PROTOCOL_TLS_SERVER ,
163
+ ssl .PROTOCOL_TLS_CLIENT
164
+ }:
165
+ # auto-negotiate protocols are always available
166
+ return True
167
+ name = protocol .name
168
+ return has_tls_version (name [len ('PROTOCOL_' ):])
169
+
170
+
171
+ @functools .lru_cache
172
+ def has_tls_version (version ):
173
+ """Check if a TLS/SSL version is enabled
174
+
175
+ :param version: TLS version name or ssl.TLSVersion member
176
+ :return: bool
177
+ """
178
+ if version == "SSLv2" :
179
+ # never supported and not even in TLSVersion enum
180
+ return False
181
+
182
+ if isinstance (version , str ):
183
+ version = ssl .TLSVersion .__members__ [version ]
184
+
185
+ # check compile time flags like ssl.HAS_TLSv1_2
186
+ if not getattr (ssl , f'HAS_{ version .name } ' ):
187
+ return False
188
+
189
+ # check runtime and dynamic crypto policy settings. A TLS version may
190
+ # be compiled in but disabled by a policy or config option.
191
+ ctx = ssl .SSLContext ()
192
+ if (
193
+ ctx .minimum_version != ssl .TLSVersion .MINIMUM_SUPPORTED and
194
+ version < ctx .minimum_version
195
+ ):
196
+ return False
197
+ if (
198
+ ctx .maximum_version != ssl .TLSVersion .MAXIMUM_SUPPORTED and
199
+ version > ctx .maximum_version
200
+ ):
201
+ return False
202
+
203
+ return True
204
+
205
+
206
+ def requires_tls_version (version ):
207
+ """Decorator to skip tests when a required TLS version is not available
208
+
209
+ :param version: TLS version name or ssl.TLSVersion member
210
+ :return:
211
+ """
212
+ def decorator (func ):
213
+ @functools .wraps (func )
214
+ def wrapper (* args , ** kw ):
215
+ if not has_tls_version (version ):
216
+ raise unittest .SkipTest (f"{ version } is not available." )
217
+ else :
218
+ return func (* args , ** kw )
219
+ return wrapper
220
+ return decorator
221
+
222
+
223
+ requires_minimum_version = unittest .skipUnless (
224
+ hasattr (ssl .SSLContext , 'minimum_version' ),
225
+ "required OpenSSL >= 1.1.0g"
226
+ )
227
+
228
+
149
229
def handle_error (prefix ):
150
230
exc_format = ' ' .join (traceback .format_exception (* sys .exc_info ()))
151
231
if support .verbose :
@@ -1107,20 +1187,23 @@ def test_hostname_checks_common_name(self):
1107
1187
with self .assertRaises (AttributeError ):
1108
1188
ctx .hostname_checks_common_name = True
1109
1189
1110
- @unittest .skipUnless (hasattr (ssl .SSLContext , 'minimum_version' ),
1111
- "required OpenSSL 1.1.0g" )
1190
+ @requires_minimum_version
1112
1191
@unittest .skipIf (IS_LIBRESSL , "see bpo-34001" )
1113
1192
def test_min_max_version (self ):
1114
1193
ctx = ssl .SSLContext (ssl .PROTOCOL_TLS_SERVER )
1115
1194
# OpenSSL default is MINIMUM_SUPPORTED, however some vendors like
1116
1195
# Fedora override the setting to TLS 1.0.
1196
+ minimum_range = {
1197
+ # stock OpenSSL
1198
+ ssl .TLSVersion .MINIMUM_SUPPORTED ,
1199
+ # Fedora 29 uses TLS 1.0 by default
1200
+ ssl .TLSVersion .TLSv1 ,
1201
+ # RHEL 8 uses TLS 1.2 by default
1202
+ ssl .TLSVersion .TLSv1_2
1203
+ }
1204
+
1117
1205
self .assertIn (
1118
- ctx .minimum_version ,
1119
- {ssl .TLSVersion .MINIMUM_SUPPORTED ,
1120
- # Fedora 29 uses TLS 1.0 by default
1121
- ssl .TLSVersion .TLSv1 ,
1122
- # RHEL 8 uses TLS 1.2 by default
1123
- ssl .TLSVersion .TLSv1_2 }
1206
+ ctx .minimum_version , minimum_range
1124
1207
)
1125
1208
self .assertEqual (
1126
1209
ctx .maximum_version , ssl .TLSVersion .MAXIMUM_SUPPORTED
@@ -1166,8 +1249,8 @@ def test_min_max_version(self):
1166
1249
1167
1250
ctx = ssl .SSLContext (ssl .PROTOCOL_TLSv1_1 )
1168
1251
1169
- self .assertEqual (
1170
- ctx .minimum_version , ssl . TLSVersion . MINIMUM_SUPPORTED
1252
+ self .assertIn (
1253
+ ctx .minimum_version , minimum_range
1171
1254
)
1172
1255
self .assertEqual (
1173
1256
ctx .maximum_version , ssl .TLSVersion .MAXIMUM_SUPPORTED
@@ -2722,6 +2805,8 @@ def test_echo(self):
2722
2805
for protocol in PROTOCOLS :
2723
2806
if protocol in {ssl .PROTOCOL_TLS_CLIENT , ssl .PROTOCOL_TLS_SERVER }:
2724
2807
continue
2808
+ if not has_tls_protocol (protocol ):
2809
+ continue
2725
2810
with self .subTest (protocol = ssl ._PROTOCOL_NAMES [protocol ]):
2726
2811
context = ssl .SSLContext (protocol )
2727
2812
context .load_cert_chain (CERTFILE )
@@ -3013,7 +3098,7 @@ def test_wrong_cert_tls12(self):
3013
3098
else :
3014
3099
self .fail ("Use of invalid cert should have failed!" )
3015
3100
3016
- @unittest . skipUnless ( ssl . HAS_TLSv1_3 , "Test needs TLS 1.3" )
3101
+ @requires_tls_version ( 'TLSv1_3' )
3017
3102
def test_wrong_cert_tls13 (self ):
3018
3103
client_context , server_context , hostname = testing_context ()
3019
3104
# load client cert that is not signed by trusted CA
@@ -3108,8 +3193,7 @@ def test_ssl_cert_verify_error(self):
3108
3193
self .assertIn (msg , repr (e ))
3109
3194
self .assertIn ('certificate verify failed' , repr (e ))
3110
3195
3111
- @unittest .skipUnless (hasattr (ssl , 'PROTOCOL_SSLv2' ),
3112
- "OpenSSL is compiled without SSLv2 support" )
3196
+ @requires_tls_version ('SSLv2' )
3113
3197
def test_protocol_sslv2 (self ):
3114
3198
"""Connecting to an SSLv2 server with various client options"""
3115
3199
if support .verbose :
@@ -3118,7 +3202,7 @@ def test_protocol_sslv2(self):
3118
3202
try_protocol_combo (ssl .PROTOCOL_SSLv2 , ssl .PROTOCOL_SSLv2 , True , ssl .CERT_OPTIONAL )
3119
3203
try_protocol_combo (ssl .PROTOCOL_SSLv2 , ssl .PROTOCOL_SSLv2 , True , ssl .CERT_REQUIRED )
3120
3204
try_protocol_combo (ssl .PROTOCOL_SSLv2 , ssl .PROTOCOL_TLS , False )
3121
- if hasattr ( ssl , 'PROTOCOL_SSLv3 ' ):
3205
+ if has_tls_version ( 'SSLv3 ' ):
3122
3206
try_protocol_combo (ssl .PROTOCOL_SSLv2 , ssl .PROTOCOL_SSLv3 , False )
3123
3207
try_protocol_combo (ssl .PROTOCOL_SSLv2 , ssl .PROTOCOL_TLSv1 , False )
3124
3208
# SSLv23 client with specific SSL options
@@ -3135,7 +3219,7 @@ def test_PROTOCOL_TLS(self):
3135
3219
"""Connecting to an SSLv23 server with various client options"""
3136
3220
if support .verbose :
3137
3221
sys .stdout .write ("\n " )
3138
- if hasattr ( ssl , 'PROTOCOL_SSLv2 ' ):
3222
+ if has_tls_version ( 'SSLv2 ' ):
3139
3223
try :
3140
3224
try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_SSLv2 , True )
3141
3225
except OSError as x :
@@ -3144,42 +3228,44 @@ def test_PROTOCOL_TLS(self):
3144
3228
sys .stdout .write (
3145
3229
" SSL2 client to SSL23 server test unexpectedly failed:\n %s\n "
3146
3230
% str (x ))
3147
- if hasattr ( ssl , 'PROTOCOL_SSLv3 ' ):
3231
+ if has_tls_version ( 'SSLv3 ' ):
3148
3232
try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_SSLv3 , False )
3149
3233
try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_TLS , True )
3150
- try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_TLSv1 , 'TLSv1' )
3234
+ if has_tls_version ('TLSv1' ):
3235
+ try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_TLSv1 , 'TLSv1' )
3151
3236
3152
- if hasattr ( ssl , 'PROTOCOL_SSLv3 ' ):
3237
+ if has_tls_version ( 'SSLv3 ' ):
3153
3238
try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_SSLv3 , False , ssl .CERT_OPTIONAL )
3154
3239
try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_TLS , True , ssl .CERT_OPTIONAL )
3155
- try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_TLSv1 , 'TLSv1' , ssl .CERT_OPTIONAL )
3240
+ if has_tls_version ('TLSv1' ):
3241
+ try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_TLSv1 , 'TLSv1' , ssl .CERT_OPTIONAL )
3156
3242
3157
- if hasattr ( ssl , 'PROTOCOL_SSLv3 ' ):
3243
+ if has_tls_version ( 'SSLv3 ' ):
3158
3244
try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_SSLv3 , False , ssl .CERT_REQUIRED )
3159
3245
try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_TLS , True , ssl .CERT_REQUIRED )
3160
- try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_TLSv1 , 'TLSv1' , ssl .CERT_REQUIRED )
3246
+ if has_tls_version ('TLSv1' ):
3247
+ try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_TLSv1 , 'TLSv1' , ssl .CERT_REQUIRED )
3161
3248
3162
3249
# Server with specific SSL options
3163
- if hasattr ( ssl , 'PROTOCOL_SSLv3 ' ):
3250
+ if has_tls_version ( 'SSLv3 ' ):
3164
3251
try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_SSLv3 , False ,
3165
3252
server_options = ssl .OP_NO_SSLv3 )
3166
3253
# Will choose TLSv1
3167
3254
try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_TLS , True ,
3168
3255
server_options = ssl .OP_NO_SSLv2 | ssl .OP_NO_SSLv3 )
3169
- try_protocol_combo ( ssl . PROTOCOL_TLS , ssl . PROTOCOL_TLSv1 , False ,
3170
- server_options = ssl .OP_NO_TLSv1 )
3171
-
3256
+ if has_tls_version ( 'TLSv1' ):
3257
+ try_protocol_combo ( ssl . PROTOCOL_TLS , ssl .PROTOCOL_TLSv1 , False ,
3258
+ server_options = ssl . OP_NO_TLSv1 )
3172
3259
3173
- @unittest .skipUnless (hasattr (ssl , 'PROTOCOL_SSLv3' ),
3174
- "OpenSSL is compiled without SSLv3 support" )
3260
+ @requires_tls_version ('SSLv3' )
3175
3261
def test_protocol_sslv3 (self ):
3176
3262
"""Connecting to an SSLv3 server with various client options"""
3177
3263
if support .verbose :
3178
3264
sys .stdout .write ("\n " )
3179
3265
try_protocol_combo (ssl .PROTOCOL_SSLv3 , ssl .PROTOCOL_SSLv3 , 'SSLv3' )
3180
3266
try_protocol_combo (ssl .PROTOCOL_SSLv3 , ssl .PROTOCOL_SSLv3 , 'SSLv3' , ssl .CERT_OPTIONAL )
3181
3267
try_protocol_combo (ssl .PROTOCOL_SSLv3 , ssl .PROTOCOL_SSLv3 , 'SSLv3' , ssl .CERT_REQUIRED )
3182
- if hasattr ( ssl , 'PROTOCOL_SSLv2 ' ):
3268
+ if has_tls_version ( 'SSLv2 ' ):
3183
3269
try_protocol_combo (ssl .PROTOCOL_SSLv3 , ssl .PROTOCOL_SSLv2 , False )
3184
3270
try_protocol_combo (ssl .PROTOCOL_SSLv3 , ssl .PROTOCOL_TLS , False ,
3185
3271
client_options = ssl .OP_NO_SSLv3 )
@@ -3189,41 +3275,40 @@ def test_protocol_sslv3(self):
3189
3275
try_protocol_combo (ssl .PROTOCOL_SSLv3 , ssl .PROTOCOL_TLS ,
3190
3276
False , client_options = ssl .OP_NO_SSLv2 )
3191
3277
3278
+ @requires_tls_version ('TLSv1' )
3192
3279
def test_protocol_tlsv1 (self ):
3193
3280
"""Connecting to a TLSv1 server with various client options"""
3194
3281
if support .verbose :
3195
3282
sys .stdout .write ("\n " )
3196
3283
try_protocol_combo (ssl .PROTOCOL_TLSv1 , ssl .PROTOCOL_TLSv1 , 'TLSv1' )
3197
3284
try_protocol_combo (ssl .PROTOCOL_TLSv1 , ssl .PROTOCOL_TLSv1 , 'TLSv1' , ssl .CERT_OPTIONAL )
3198
3285
try_protocol_combo (ssl .PROTOCOL_TLSv1 , ssl .PROTOCOL_TLSv1 , 'TLSv1' , ssl .CERT_REQUIRED )
3199
- if hasattr ( ssl , 'PROTOCOL_SSLv2 ' ):
3286
+ if has_tls_version ( 'SSLv2 ' ):
3200
3287
try_protocol_combo (ssl .PROTOCOL_TLSv1 , ssl .PROTOCOL_SSLv2 , False )
3201
- if hasattr ( ssl , 'PROTOCOL_SSLv3 ' ):
3288
+ if has_tls_version ( 'SSLv3 ' ):
3202
3289
try_protocol_combo (ssl .PROTOCOL_TLSv1 , ssl .PROTOCOL_SSLv3 , False )
3203
3290
try_protocol_combo (ssl .PROTOCOL_TLSv1 , ssl .PROTOCOL_TLS , False ,
3204
3291
client_options = ssl .OP_NO_TLSv1 )
3205
3292
3206
- @unittest .skipUnless (hasattr (ssl , "PROTOCOL_TLSv1_1" ),
3207
- "TLS version 1.1 not supported." )
3293
+ @requires_tls_version ('TLSv1_1' )
3208
3294
def test_protocol_tlsv1_1 (self ):
3209
3295
"""Connecting to a TLSv1.1 server with various client options.
3210
3296
Testing against older TLS versions."""
3211
3297
if support .verbose :
3212
3298
sys .stdout .write ("\n " )
3213
3299
try_protocol_combo (ssl .PROTOCOL_TLSv1_1 , ssl .PROTOCOL_TLSv1_1 , 'TLSv1.1' )
3214
- if hasattr ( ssl , 'PROTOCOL_SSLv2 ' ):
3300
+ if has_tls_version ( 'SSLv2 ' ):
3215
3301
try_protocol_combo (ssl .PROTOCOL_TLSv1_1 , ssl .PROTOCOL_SSLv2 , False )
3216
- if hasattr ( ssl , 'PROTOCOL_SSLv3 ' ):
3302
+ if has_tls_version ( 'SSLv3 ' ):
3217
3303
try_protocol_combo (ssl .PROTOCOL_TLSv1_1 , ssl .PROTOCOL_SSLv3 , False )
3218
3304
try_protocol_combo (ssl .PROTOCOL_TLSv1_1 , ssl .PROTOCOL_TLS , False ,
3219
3305
client_options = ssl .OP_NO_TLSv1_1 )
3220
3306
3221
3307
try_protocol_combo (ssl .PROTOCOL_TLS , ssl .PROTOCOL_TLSv1_1 , 'TLSv1.1' )
3222
- try_protocol_combo (ssl .PROTOCOL_TLSv1_1 , ssl .PROTOCOL_TLSv1 , False )
3223
- try_protocol_combo (ssl .PROTOCOL_TLSv1 , ssl .PROTOCOL_TLSv1_1 , False )
3308
+ try_protocol_combo (ssl .PROTOCOL_TLSv1_1 , ssl .PROTOCOL_TLSv1_2 , False )
3309
+ try_protocol_combo (ssl .PROTOCOL_TLSv1_2 , ssl .PROTOCOL_TLSv1_1 , False )
3224
3310
3225
- @unittest .skipUnless (hasattr (ssl , "PROTOCOL_TLSv1_2" ),
3226
- "TLS version 1.2 not supported." )
3311
+ @requires_tls_version ('TLSv1_2' )
3227
3312
def test_protocol_tlsv1_2 (self ):
3228
3313
"""Connecting to a TLSv1.2 server with various client options.
3229
3314
Testing against older TLS versions."""
@@ -3232,9 +3317,9 @@ def test_protocol_tlsv1_2(self):
3232
3317
try_protocol_combo (ssl .PROTOCOL_TLSv1_2 , ssl .PROTOCOL_TLSv1_2 , 'TLSv1.2' ,
3233
3318
server_options = ssl .OP_NO_SSLv3 | ssl .OP_NO_SSLv2 ,
3234
3319
client_options = ssl .OP_NO_SSLv3 | ssl .OP_NO_SSLv2 ,)
3235
- if hasattr ( ssl , 'PROTOCOL_SSLv2 ' ):
3320
+ if has_tls_version ( 'SSLv2 ' ):
3236
3321
try_protocol_combo (ssl .PROTOCOL_TLSv1_2 , ssl .PROTOCOL_SSLv2 , False )
3237
- if hasattr ( ssl , 'PROTOCOL_SSLv3 ' ):
3322
+ if has_tls_version ( 'SSLv3 ' ):
3238
3323
try_protocol_combo (ssl .PROTOCOL_TLSv1_2 , ssl .PROTOCOL_SSLv3 , False )
3239
3324
try_protocol_combo (ssl .PROTOCOL_TLSv1_2 , ssl .PROTOCOL_TLS , False ,
3240
3325
client_options = ssl .OP_NO_TLSv1_2 )
@@ -3677,7 +3762,7 @@ def test_version_basic(self):
3677
3762
self .assertIs (s .version (), None )
3678
3763
self .assertIs (s ._sslobj , None )
3679
3764
s .connect ((HOST , server .port ))
3680
- if IS_OPENSSL_1_1_1 and ssl . HAS_TLSv1_3 :
3765
+ if IS_OPENSSL_1_1_1 and has_tls_version ( 'TLSv1_3' ) :
3681
3766
self .assertEqual (s .version (), 'TLSv1.3' )
3682
3767
elif ssl .OPENSSL_VERSION_INFO >= (1 , 0 , 2 ):
3683
3768
self .assertEqual (s .version (), 'TLSv1.2' )
@@ -3686,8 +3771,7 @@ def test_version_basic(self):
3686
3771
self .assertIs (s ._sslobj , None )
3687
3772
self .assertIs (s .version (), None )
3688
3773
3689
- @unittest .skipUnless (ssl .HAS_TLSv1_3 ,
3690
- "test requires TLSv1.3 enabled OpenSSL" )
3774
+ @requires_tls_version ('TLSv1_3' )
3691
3775
def test_tls1_3 (self ):
3692
3776
context = ssl .SSLContext (ssl .PROTOCOL_TLS )
3693
3777
context .load_cert_chain (CERTFILE )
@@ -3704,9 +3788,9 @@ def test_tls1_3(self):
3704
3788
})
3705
3789
self .assertEqual (s .version (), 'TLSv1.3' )
3706
3790
3707
- @unittest . skipUnless ( hasattr ( ssl . SSLContext , 'minimum_version' ),
3708
- "required OpenSSL 1.1.0g" )
3709
- def test_min_max_version (self ):
3791
+ @requires_minimum_version
3792
+ @ requires_tls_version ( 'TLSv1_2' )
3793
+ def test_min_max_version_tlsv1_2 (self ):
3710
3794
client_context , server_context , hostname = testing_context ()
3711
3795
# client TLSv1.0 to 1.2
3712
3796
client_context .minimum_version = ssl .TLSVersion .TLSv1
@@ -3721,7 +3805,13 @@ def test_min_max_version(self):
3721
3805
s .connect ((HOST , server .port ))
3722
3806
self .assertEqual (s .version (), 'TLSv1.2' )
3723
3807
3808
+ @requires_minimum_version
3809
+ @requires_tls_version ('TLSv1_1' )
3810
+ def test_min_max_version_tlsv1_1 (self ):
3811
+ client_context , server_context , hostname = testing_context ()
3724
3812
# client 1.0 to 1.2, server 1.0 to 1.1
3813
+ client_context .minimum_version = ssl .TLSVersion .TLSv1
3814
+ client_context .maximum_version = ssl .TLSVersion .TLSv1_2
3725
3815
server_context .minimum_version = ssl .TLSVersion .TLSv1
3726
3816
server_context .maximum_version = ssl .TLSVersion .TLSv1_1
3727
3817
@@ -3731,6 +3821,10 @@ def test_min_max_version(self):
3731
3821
s .connect ((HOST , server .port ))
3732
3822
self .assertEqual (s .version (), 'TLSv1.1' )
3733
3823
3824
+ @requires_minimum_version
3825
+ @requires_tls_version ('TLSv1_2' )
3826
+ def test_min_max_version_mismatch (self ):
3827
+ client_context , server_context , hostname = testing_context ()
3734
3828
# client 1.0, server 1.2 (mismatch)
3735
3829
server_context .maximum_version = ssl .TLSVersion .TLSv1_2
3736
3830
server_context .minimum_version = ssl .TLSVersion .TLSv1_2
@@ -3743,10 +3837,8 @@ def test_min_max_version(self):
3743
3837
s .connect ((HOST , server .port ))
3744
3838
self .assertIn ("alert" , str (e .exception ))
3745
3839
3746
-
3747
- @unittest .skipUnless (hasattr (ssl .SSLContext , 'minimum_version' ),
3748
- "required OpenSSL 1.1.0g" )
3749
- @unittest .skipUnless (ssl .HAS_SSLv3 , "requires SSLv3 support" )
3840
+ @requires_minimum_version
3841
+ @requires_tls_version ('SSLv3' )
3750
3842
def test_min_max_version_sslv3 (self ):
3751
3843
client_context , server_context , hostname = testing_context ()
3752
3844
server_context .minimum_version = ssl .TLSVersion .SSLv3
@@ -4270,7 +4362,7 @@ def test_session_handling(self):
4270
4362
'Session refers to a different SSLContext.' )
4271
4363
4272
4364
4273
- @unittest .skipUnless (ssl . HAS_TLSv1_3 , "Test needs TLS 1.3" )
4365
+ @unittest .skipUnless (has_tls_version ( 'TLSv1_3' ) , "Test needs TLS 1.3" )
4274
4366
class TestPostHandshakeAuth (unittest .TestCase ):
4275
4367
def test_pha_setter (self ):
4276
4368
protocols = [
0 commit comments