8// TLSInfo returns human-readable strings about the TLS connection, for use in
10func TLSInfo(conn *tls.Conn) (version, ciphersuite string) {
11 st := conn.ConnectionState()
13 versions := map[uint16]string{
14 tls.VersionTLS10: "TLS1.0",
15 tls.VersionTLS11: "TLS1.1",
16 tls.VersionTLS12: "TLS1.2",
17 tls.VersionTLS13: "TLS1.3",
20 v, ok := versions[st.Version]
24 version = fmt.Sprintf("TLS %x", st.Version)
27 ciphersuite = tls.CipherSuiteName(st.CipherSuite)