Mutualize TLS version and cipher code
This commit is contained in:
parent
b05a5c818d
commit
4b370930b5
4 changed files with 27 additions and 41 deletions
|
@ -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"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue