Use consistent lower-case names when logging tls version and ciphersuite

Less shouty than upper case names.
This commit is contained in:
Mechiel Lukkien
2025-03-05 21:58:24 +01:00
parent aa2b24d861
commit 7872b138a5
5 changed files with 22 additions and 40 deletions

View File

@ -7,13 +7,13 @@ import (
"fmt"
"log/slog"
"runtime/debug"
"strings"
"time"
"github.com/mjl-/bstore"
"github.com/mjl-/mox/metrics"
"github.com/mjl-/mox/mlog"
"github.com/mjl-/mox/moxio"
)
var loginAttemptsMaxPerAccount = 10 * 1000 // Lower during tests.
@ -353,9 +353,10 @@ func LoginAttemptTLS(state *tls.ConnectionState) string {
return ""
}
version, ciphersuite := moxio.TLSInfo(*state)
return fmt.Sprintf("version=%s ciphersuite=%s sni=%s resumed=%v alpn=%s",
strings.ReplaceAll(strings.ToLower(tls.VersionName(state.Version)), " ", ""), // e.g. tls1.3
strings.ToLower(tls.CipherSuiteName(state.CipherSuite)),
version,
ciphersuite,
state.ServerName,
state.DidResume,
state.NegotiatedProtocol)