Skip to content

Commit c2e3862

Browse files
Merge branch 'main' into ec_bindings
2 parents 9b70a7b + 4bad1a6 commit c2e3862

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

awscrt/io.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ class TlsCipherPref(IntEnum):
277277
PQ_DEFAULT = 8 # :
278278
"""Recommended default policy with post-quantum algorithm support. This policy may change over time."""
279279

280+
TLSv1_2_2025_07 = 9
281+
"""A TLS Cipher Preference requiring TLS 1.2+ with FIPS compliance and perfect forward secrecy. This security policy
282+
is based on the AWS-CRT-SDK-TLSv1.2-2023 s2n TLS policy with enhanced security restrictions. It supports AES-GCM and
283+
ECDHE cipher suites with ECDSA and RSA-PSS signature schemes, and uses NIST P-256 and P-384 curves only."""
284+
280285
def is_supported(self):
281286
"""Return whether this Cipher Preference is available in the underlying platform's TLS implementation"""
282287
return _awscrt.is_tls_cipher_supported(self.value)

test/test_io.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,21 @@ def test_override_default_trust_store_file(self):
113113
opt.override_default_trust_store_from_path(None, 'test/resources/ca.crt')
114114
ctx = ClientTlsContext(opt)
115115

116+
def test_set_cipher_preference_tlsv1_2_2025(self):
117+
opt = TlsContextOptions()
118+
opt.cipher_pref = TlsCipherPref.TLSv1_2_2025_07
119+
120+
try:
121+
ctx = ClientTlsContext(opt)
122+
except Exception as e:
123+
if sys.platform.startswith("linux"):
124+
# On Linux, this should not fail
125+
self.fail(f"Unexpected error on Linux: {e}")
126+
else:
127+
# On non-Linux platforms, verify we get the expected error and skip
128+
self.assertIn('AWS_IO_TLS_CIPHER_PREF_UNSUPPORTED', str(e))
129+
self.skipTest(f"TLSv1_2_2025_07 not supported on {sys.platform}")
130+
116131

117132
class TlsConnectionOptionsTest(NativeResourceTest):
118133
def test_init(self):

0 commit comments

Comments
 (0)