Avoid nil deref when using Postgres StartTLS

Fixes #234
This commit is contained in:
Eli Young
2021-07-15 13:04:33 -07:00
parent aea8d76741
commit 908eebe3d9
+4
View File
@@ -247,6 +247,10 @@ func GetConnectionState(startTLSType, connectName, connectTo, identity, clientCe
return nil, nil, fmt.Errorf("error connecting: %v", result.err)
}
if cri == nil {
return result.state, nil, nil
}
if result.state.Version < tls.VersionTLS12 && *cri != nil {
// Sending supported signature schemes was added in TLS 1.2,
// but Go lies to us in the GetClientCertificate callback and