mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-30 08:30:48 +00:00
enhance(tls): use go's tls defaults (#38687)
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.
This commit is contained in:
+2
-19
@@ -111,25 +111,8 @@ func runACME(listenAddr string, m http.Handler) error {
|
||||
}
|
||||
}
|
||||
|
||||
tlsConfig := magic.TLSConfig()
|
||||
tlsConfig.NextProtos = append(tlsConfig.NextProtos, "h2")
|
||||
|
||||
if version := toTLSVersion(setting.SSLMinimumVersion); version != 0 {
|
||||
tlsConfig.MinVersion = version
|
||||
}
|
||||
if version := toTLSVersion(setting.SSLMaximumVersion); version != 0 {
|
||||
tlsConfig.MaxVersion = version
|
||||
}
|
||||
|
||||
// Set curve preferences
|
||||
if curves := toCurvePreferences(setting.SSLCurvePreferences); len(curves) > 0 {
|
||||
tlsConfig.CurvePreferences = curves
|
||||
}
|
||||
|
||||
// Set cipher suites
|
||||
if ciphers := toTLSCiphers(setting.SSLCipherSuites); len(ciphers) > 0 {
|
||||
tlsConfig.CipherSuites = ciphers
|
||||
}
|
||||
// certmagic only advertises its own ACME challenge protocol, applyTLSSettings appends ours
|
||||
tlsConfig := applyTLSSettings(magic.TLSConfig())
|
||||
|
||||
if enableHTTPChallenge {
|
||||
go func() {
|
||||
|
||||
Reference in New Issue
Block a user