Mutualize TLS version and cipher code

This commit is contained in:
Romain 2021-01-20 04:08:03 +01:00 committed by GitHub
parent b05a5c818d
commit 4b370930b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 41 deletions

View file

@ -69,3 +69,13 @@ var (
tls.TLS_FALLBACK_SCSV: `TLS_FALLBACK_SCSV`,
}
)
// GetCipherName returns the Cipher suite name.
// Available CipherSuites defined at https://golang.org/pkg/crypto/tls/#pkg-constants
func GetCipherName(connState *tls.ConnectionState) string {
if cipher, ok := CipherSuitesReversed[connState.CipherSuite]; ok {
return cipher
}
return "unknown"
}