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

@ -628,9 +628,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)),
@ -644,12 +645,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))), " ", "-")
}
// completely reset connection state as if greeting has just been sent.
// ../rfc/3207:210
func (c *conn) reset() {