mirror of https://github.com/jackc/pgx.git
Run go fmt
parent
cdd2cc4124
commit
69b99209fb
|
@ -715,16 +715,16 @@ func configTLS(settings map[string]string, thisHost string, parseConfigOptions P
|
||||||
if x509.IsEncryptedPEMBlock(block) {
|
if x509.IsEncryptedPEMBlock(block) {
|
||||||
// Attempt decryption with pass phrase
|
// Attempt decryption with pass phrase
|
||||||
// NOTE: only supports RSA (PKCS#1)
|
// NOTE: only supports RSA (PKCS#1)
|
||||||
if(sslpassword != ""){
|
if sslpassword != "" {
|
||||||
decryptedKey, decryptedError = x509.DecryptPEMBlock(block, []byte(sslpassword))
|
decryptedKey, decryptedError = x509.DecryptPEMBlock(block, []byte(sslpassword))
|
||||||
}
|
}
|
||||||
//if sslpassword not provided or has decryption error when use it
|
//if sslpassword not provided or has decryption error when use it
|
||||||
//try to find sslpassword with callback function
|
//try to find sslpassword with callback function
|
||||||
if (sslpassword == "" || decryptedError!= nil) {
|
if sslpassword == "" || decryptedError != nil {
|
||||||
if(parseConfigOptions.GetSSLPassword != nil){
|
if parseConfigOptions.GetSSLPassword != nil {
|
||||||
sslpassword = parseConfigOptions.GetSSLPassword(context.Background())
|
sslpassword = parseConfigOptions.GetSSLPassword(context.Background())
|
||||||
}
|
}
|
||||||
if(sslpassword == ""){
|
if sslpassword == "" {
|
||||||
return nil, fmt.Errorf("unable to find sslpassword")
|
return nil, fmt.Errorf("unable to find sslpassword")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package pgconn
|
package pgconn
|
||||||
|
|
Loading…
Reference in New Issue