4040 import ctypes
4141except ImportError :
4242 ctypes = None
43+ try :
44+ from _hashlib import get_fips_mode
45+ except ImportError :
46+ def get_fips_mode (): return False
4347
4448
4549ssl = import_helper .import_module ("ssl" )
@@ -2478,6 +2482,9 @@ def test_outer_alpn_does_not_replace_inner(self):
24782482 self .assertEqual (server .selected_alpn_protocol (), 'h2' )
24792483
24802484 @unittest .skipUnless (ssl .HAS_ECH , 'requires ECH' )
2485+ # At 2026-11-13 (OpenSSL 4.0.3 on Fedora 45), the test is incompatible
2486+ # with FIPS mode: https://github.com/openssl/openssl/issues/33724
2487+ @unittest .skipIf (get_fips_mode (), 'gh-161932: test incompatible with FIPS' )
24812488 def test_outer_alpn_without_ech_config (self ):
24822489 for options in (0 , ssl .OP_ECH_GREASE ):
24832490 client_ctx , server_ctx , hostname = testing_context ()
@@ -2491,6 +2498,9 @@ def test_outer_alpn_without_ech_config(self):
24912498 self .assertEqual (server .selected_alpn_protocol (), 'h2' )
24922499
24932500 @unittest .skipUnless (ssl .HAS_ECH , 'requires ECH' )
2501+ # At 2026-11-13 (OpenSSL 4.0.3 on Fedora 45), the test is incompatible
2502+ # with FIPS mode: https://github.com/openssl/openssl/issues/33724
2503+ @unittest .skipIf (get_fips_mode (), 'gh-161932: test incompatible with FIPS' )
24942504 def test_grease (self ):
24952505 client_ctx , server_ctx , hostname = testing_context ()
24962506 client_ctx .options |= ssl .OP_ECH_GREASE
0 commit comments