chore(ota): only show selected TLS connection state fields in trace logging

This commit is contained in:
Siyuan 2025-11-18 14:33:12 +00:00
parent fc8cfadb9f
commit ad8acd0902
1 changed files with 6 additions and 1 deletions

View File

@ -84,7 +84,12 @@ func (s *State) newHTTPRequestWithTrace(ctx context.Context, method, url string,
}, },
TLSHandshakeStart: func() { l().Msg("[tls] handshake started") }, TLSHandshakeStart: func() { l().Msg("[tls] handshake started") },
TLSHandshakeDone: func(state tls.ConnectionState, err error) { TLSHandshakeDone: func(state tls.ConnectionState, err error) {
l().Interface("state", state).Err(err).Msg("[tls] handshake done") l().
Str("tlsVersion", tls.VersionName(state.Version)).
Str("cipherSuite", tls.CipherSuiteName(state.CipherSuite)).
Str("negotiatedProtocol", state.NegotiatedProtocol).
Str("serverName", state.ServerName).
Err(err).Msg("[tls] handshake done")
}, },
}) })
} }