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

@ -1096,9 +1096,10 @@ func (c *conn) xtlsHandshakeAndAuthenticate(conn net.Conn) {
}
}
version, ciphersuite := moxio.TLSInfo(cs)
attrs := []slog.Attr{
slog.Any("version", tlsVersion(cs.Version)),
slog.String("ciphersuite", tls.CipherSuiteName(cs.CipherSuite)),
slog.String("version", version),
slog.String("ciphersuite", ciphersuite),
slog.String("sni", cs.ServerName),
slog.Bool("resumed", cs.DidResume),
slog.Int("clientcerts", len(cs.PeerCertificates)),
@ -1112,12 +1113,6 @@ func (c *conn) xtlsHandshakeAndAuthenticate(conn net.Conn) {
c.log.Debug("tls handshake completed", attrs...)
}
type tlsVersion uint16
func (v tlsVersion) String() string {
return strings.ReplaceAll(strings.ToLower(tls.VersionName(uint16(v))), " ", "-")
}
func (c *conn) command() {
var tag, cmd, cmdlow string
var p *parser