traefik/pkg/tls/version.go
Jean-Baptiste Doumenjou fffa413121
Fix golang doc URLs
2021-09-10 11:42:07 +02:00

20 lines
431 B
Go

package tls
import "crypto/tls"
// GetVersion returns the normalized TLS version.
// Available TLS versions defined at https://pkg.go.dev/crypto/tls/#pkg-constants
func GetVersion(connState *tls.ConnectionState) string {
switch connState.Version {
case tls.VersionTLS10:
return "1.0"
case tls.VersionTLS11:
return "1.1"
case tls.VersionTLS12:
return "1.2"
case tls.VersionTLS13:
return "1.3"
}
return "unknown"
}