Skip to content

Commit

Permalink
sessionctx: Remove SSLv3 references
Browse files Browse the repository at this point in the history
This removes references to SSLv3, which as far as I know was never
supported by TiDB or MySQL.

When the TLS version isn't found in the map it now returns
'unknown_tls_version' in the status var.

Closes pingcap#13958
  • Loading branch information
dveeden committed Apr 20, 2021
1 parent fa39b79 commit d7026e5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sessionctx/variable/statusvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ var tlsSupportedCiphers string

// Taken from https://github.com/openssl/openssl/blob/c784a838e0947fcca761ee62def7d077dc06d37f/include/openssl/ssl.h#L141 .
var tlsVersionString = map[uint16]string{
tls.VersionSSL30: "SSLv3",
tls.VersionTLS10: "TLSv1",
tls.VersionTLS11: "TLSv1.1",
tls.VersionTLS12: "TLSv1.2",
Expand Down Expand Up @@ -137,7 +136,11 @@ func (s defaultStatusStat) Stats(vars *SessionVars) (map[string]interface{}, err
statusVars["Ssl_cipher_list"] = tlsSupportedCiphers
// tls.VerifyClientCertIfGiven == SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE
statusVars["Ssl_verify_mode"] = 0x01 | 0x04
statusVars["Ssl_version"] = tlsVersionString[vars.TLSConnectionState.Version]
if tlsVersion, tlsVersionKnown := tlsVersionString[vars.TLSConnectionState.Version]; tlsVersionKnown {
statusVars["Ssl_version"] = tlsVersion
} else {
statusVars["Ssl_version"] = "unknown_tls_version"
}
}

return statusVars, nil
Expand Down

0 comments on commit d7026e5

Please sign in to comment.