Skip to content

enhance(tls): use go's tls defaults - #38687

Open
silverwind wants to merge 2 commits into
go-gitea:mainfrom
silverwind:tls-go-defaults
Open

enhance(tls): use go's tls defaults#38687
silverwind wants to merge 2 commits into
go-gitea:mainfrom
silverwind:tls-go-defaults

Conversation

@silverwind

@silverwind silverwind commented Jul 28, 2026

Copy link
Copy Markdown
Member

The hardcoded cipher suites and curve preferences date from 2021 and no longer match what Go ships. All four SSL_* are now unset by default which means "use Go's default".

  1. TLS 1.3 is now the default instead of TLS 1.2.
  2. Post-quantum key exchange (X25519MLKEM768) works.
  3. Four ECDHE-*-CBC-SHA suites become negotiable on TLS 1.2.
  4. SSL_CURVE_PREFERENCES=X25519,P256 now disables post-quantum.

The hardcoded cipher suites and curve preferences date from 2021 and no
longer match what Go ships. Leaving them unset lets crypto/tls decide, so
post-quantum key exchange becomes available and the AES-vs-ChaCha hardware
check stops duplicating what crypto/tls already does internally.

An unset SSL_MAX_VERSION also resolved to TLS 1.2, which silently capped
every default HTTPS install below TLS 1.3 on both the manual certificate
and ACME paths.

All four SSL_* options are kept and now mean "use Go's default" when unset,
so a narrower cipher or curve policy can still be configured explicitly.

The MinVersion floor in graceful duplicated Go's own server default and
prevented GODEBUG=tls10server=1 from ever taking effect.

Assisted-by: Claude Code:Opus 5
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 28, 2026
@github-actions github-actions Bot added type/feature Completely new functionality. Can only be merged if feature freeze is not active. docs-update-needed The document needs to be updated synchronously labels Jul 28, 2026
@silverwind silverwind changed the title feat(tls): follow Go's defaults for the built-in HTTPS server enhance(tls): use go's tls defaults Jul 28, 2026
@github-actions github-actions Bot added type/enhancement An improvement of existing functionality and removed type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Jul 28, 2026
@silverwind

Copy link
Copy Markdown
Member Author

Wonder if we should flag this as breaking for the change from TLS 1.2 to 1.3.

Comment thread cmd/web_https_test.go Outdated
Signed-off-by: silverwind <me@silverwind.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-update-needed The document needs to be updated synchronously lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. type/enhancement An improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants