Skip to content

tlsconfig: add ChaCha20-Poly1305 cipher suites#153

Merged
thaJeztah merged 1 commit intodocker:mainfrom
thaJeztah:chachacha
Mar 25, 2026
Merged

tlsconfig: add ChaCha20-Poly1305 cipher suites#153
thaJeztah merged 1 commit intodocker:mainfrom
thaJeztah:chachacha

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

tlsconfig: add ChaCha20-Poly1305 cipher suites

The tlsconfig package provides a curated set of ciphers, with insecure
ciphers removed; originally because Go stdlib included all ciphers by
default (including insecure ones). Current versions of Go provide a much
saner set of defaults, that closely matches the defaults as set in the
tlsconfig package in this module;

  • Go 1.8 added ChaCha20-Poly1305 cipher suites
  • Go 1.22 removed RSA key-exchange suites from default list
  • Go 1.23 removed 3DES suites from default list
cipher go-connections stdlib defaults
TLS_RSA_WITH_AES_128_GCM_SHA256 ✗ (insecure) ✗ (since go1.22)
TLS_RSA_WITH_AES_256_GCM_SHA384 ✗ (insecure) ✗ (since go1.22)
TLS_RSA_WITH_AES_128_CBC_SHA ✗ (insecure) ✗ (since go1.22)
TLS_RSA_WITH_AES_256_CBC_SHA ✗ (insecure) ✗ (since go1.22)
TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA ✗ (insecure) ✗ (since go1.23)
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA ✗ (legacy, non-AEAD)
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA ✗ (legacy, non-AEAD)
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA ✗ (legacy, non-AEAD)
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA ✗ (legacy, non-AEAD)
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 ✓ (added in go1.8)
TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 ✓ (added in go1.8)

From the above table, differences are;

  • Go still includes legacy, non-AEAD (TLS 1.2 CBC suites); these are still considered safe,
    but superseded by AEAD ciphers (AES-GCM, ChaCha20) and mainly retained for compatibility.
  • Go 1.8 and up added ChaCha20-Poly1305 cipher suites (see https://go-review.googlesource.com/c/go/+/30958).

This patch adds the ChaCha20-Poly1305 cipher suites to align closer with the
set of cipher suites provided by default in Go stdlib.

Note that this only impacts TLS 1.2 (and older, but we don't allow TLS 1.1);
for TLS 1.3, Go does not allow overriding the list of supported ciphers.

- Description for the changelog

tlsconfig: add ChaCha20-Poly1305 cipher suites

- A picture of a cute animal (not mandatory but encouraged)

The tlsconfig package provides a curated set of ciphers, with insecure
ciphers removed; originally because Go stdlib included all ciphers by
default (including insecure ones). Current versions of Go provide a much
saner set of defaults, that closely matches the defaults as set in the
tlsconfig package in this module;

- Go 1.8 added ChaCha20-Poly1305 cipher suites
- Go 1.22 removed RSA key-exchange suites from default list
- Go 1.23 removed 3DES suites from default list

| cipher                                        | go-connections       | stdlib defaults    |
|-----------------------------------------------|----------------------|--------------------|
| TLS_RSA_WITH_AES_128_GCM_SHA256               | ✗ (insecure)         | ✗ (since go1.22)   |
| TLS_RSA_WITH_AES_256_GCM_SHA384               | ✗ (insecure)         | ✗ (since go1.22)   |
| TLS_RSA_WITH_AES_128_CBC_SHA                  | ✗ (insecure)         | ✗ (since go1.22)   |
| TLS_RSA_WITH_AES_256_CBC_SHA                  | ✗ (insecure)         | ✗ (since go1.22)   |
| TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA           | ✗ (insecure)         | ✗ (since go1.23)   |
| TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA          | ✗ (legacy, non-AEAD) | ✓                  |
| TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA          | ✗ (legacy, non-AEAD) | ✓                  |
| TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA            | ✗ (legacy, non-AEAD) | ✓                  |
| TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA            | ✗ (legacy, non-AEAD) | ✓                  |
| TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256       | ✓                    | ✓                  |
| TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384       | ✓                    | ✓                  |
| TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256         | ✓                    | ✓                  |
| TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384         | ✓                    | ✓                  |
| TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256   | ✗                    | ✓ (added in go1.8) |
| TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 | ✗                    | ✓ (added in go1.8) |

From the above table, differences are;

- Go still includes legacy, non-AEAD (TLS 1.2 CBC suites); these are still considered safe,
  but superseded by AEAD ciphers (AES-GCM, ChaCha20) and mainly retained for compatibility.
- Go 1.8 and up added ChaCha20-Poly1305 cipher suites (see https://go-review.googlesource.com/c/go/+/30958).

This patch adds the ChaCha20-Poly1305 cipher suites to align closer with the
set of cipher suites provided by default in Go stdlib.

Note that this only impacts TLS 1.2 (and older, but we don't allow TLS 1.1);
for TLS 1.3, Go does not allow overriding the list of supported ciphers.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Copy link
Copy Markdown
Contributor

@tao12345666333 tao12345666333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit 0a1293a into docker:main Mar 25, 2026
10 checks passed
@thaJeztah thaJeztah deleted the chachacha branch March 25, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants