Security Policies

s2n-tls uses pre-made security policies to help avoid common misconfiguration mistakes for TLS.

s2n_config_set_cipher_preferences() sets a security policy, which includes the cipher/kem/signature/ecc preferences and protocol version.

Supported TLS Versions

Currently TLS 1.2 is our default version, but we recommend TLS 1.3 where possible. To use TLS 1.3 you need a security policy that supports TLS 1.3. Note: s2n-tls does not support SSL2.0 for sending and receiving encrypted data, but does accept SSL2.0 hello messages.

Chart: Security Policy Version To Protocol Version And Ciphersuites

The following chart maps the security policy version to protocol version and ciphersuites supported.

versionTLS1.0TLS1.1TLS1.2TLS1.3AES-CBCAES-GCMCHACHAPOLY3DESRC4DHEECDHERSA kx
defaultXXXX
default_fipsXXXX
default_tls13XXXXXX
20240501XXXX
20240502XXXX
20240503XXXXX
20230317XXXXX
20240331XXXX
20190214XXXXXXXXX
20170718XXXXXXX
20170405XXXXXXXX
20170328XXXXXXXXX
20170210XXXXXXXX
20160824XXXXXXX
20160804XXXXXXXX
20160411XXXXXXXX
20150306XXXXXXXX
20150214XXXXXXXX
20150202XXXXXXX
20141001XXXXXXXX
20190120XXXXXXXXX
20190121XXXXXXXXX
20190122XXXXXXXXX
20190801XXXXXXXXX
20190802XXXXXXXXX
20200207XXXX
rfc9151XXXXXX

The "default", "default_tls13", and "default_fips" versions are special in that they will be updated with future s2n-tls changes to keep up-to-date with current security best practices. Ciphersuites, protocol versions, and other options may be added or removed, or their internal order of preference might change. Warning: this means that the default policies may change as a result of library updates, which could break peers that rely on legacy options.

In contrast, numbered or dated versions are fixed and will never change. The numbered equivalents of the default policies are currently:

  • "default": "20240501"
  • "default_fips": "20240502"
  • "default_tls13": "20240503" For previous defaults, see the "Default Policy History" section below.

"default_fips" does not currently support TLS1.3. If you need a policy that supports both FIPS and TLS1.3, choose "20230317". We plan to add TLS1.3 support to both "default" and "default_fips" in the future.

"rfc9151" is derived from Commercial National Security Algorithm (CNSA) Suite Profile for TLS and DTLS 1.2 and 1.3. This policy restricts the algorithms allowed for signatures on certificates in the certificate chain to RSA or ECDSA with sha384, which may require you to update your certificates. Like the default policies, this policy may also change if the source RFC definition changes.

s2n-tls does not expose an API to control the order of preference for each ciphersuite or protocol version. s2n-tls follows the following order:

  1. Always prefer the highest protocol version supported
  2. Always use forward secrecy where possible. Prefer ECDHE over DHE.
  3. Prefer encryption ciphers in the following order: AES128, AES256, ChaCha20, 3DES, RC4.
  4. Prefer record authentication modes in the following order: GCM, Poly1305, SHA256, SHA1, MD5.

NOTE: ChaCha20-Poly1305 cipher suites will not be available if s2n-tls is built with an older libcrypto like openssl-1.0.2. The underlying encrypt/decrypt functions are not available in older versions.

ChaCha20 Boosting

s2n-tls usually prefers AES over ChaCha20. However, some clients-- particularly mobile or IOT devices-- do not support AES hardware acceleration, making AES less efficient and performant than ChaCha20. In this case, clients will indicate their preference for ChaCha20 by listing it first during cipher suite negotiation. Usually s2n-tls servers ignore client preferences, but s2n-tls offers "ChaCha20 boosted" security policies that will choose ChaCha20 over AES if the client indicates a preference for ChaCha20. This is available in the "CloudFront-TLS-1-2-2021-ChaCha20-Boosted" policy, which is identical to the "CloudFront-TLS-1-2-2021" policy listed above but with ChaCha20 Boosting enabled.

Chart: Security Policy Version To Supported Signature Schemes

versionRSA PKCS1ECDSASHA-1 LegacyRSA PSS
defaultXXX
default_fipsXXX
default_tls13XXX
20240501XXX
20240502XXX
20240503XXX
20230317XXX
20190214XXX
20170718XX
20170405XX
20170328XX
20170210XX
20160824XX
20160804XX
20160411XX
20150306XX
20150214XX
20150202XX
20141001XX
20190120XX
20190121XX
20190122XX
20190801XXXX
20190802XXXX
20200207XX
rfc9151XXX

NOTE: Legacy SHA-1 algorithms are not supported in TLS1.3. Legacy SHA-1 algorithms will be supported only if TLS1.2 has been negotiated and the security policy allows them.

NOTE: RSA-PSS certificates will not be available if s2n-tls is built with an older libcrypto like openssl-1.0.2. RSA certificate signatures with PSS padding (RSA-PSS-RSAE) will still be available, but RSA-PSS certificate signatures with PSS padding (RSA-PSS-PSS) will not be available.

Chart: Security policy version to supported curves/groups

versionsecp256r1secp384r1x25519
defaultXXX
default_fipsXX
default_tls13XXX
20240501XXX
20240502XX
20240503XXX
20230317XX
20190214XX
20170718XX
20170405XX
20170328XX
20170210XX
20160824XX
20160804XX
20160411XX
20150306XX
20150214
20150202
20141001
20190120XX
20190121XX
20190122XX
20190801XXX
20190802XX
20200207XXX
rfc9151X

Default Policy History

Version"default""default_fips""default_tls13"
v1.4.16202405012024050220240503
Older201702102024041620240417