Skip to content

Commit 77fcc7e

Browse files
authored
Merge pull request jackc#2509 from m-ocean-it/return-correct-err-for-decryptpemblock
fix returning wrong error in configTLS when DecryptPEMBlock fails
2 parents 21cc9fc + aa4f841 commit 77fcc7e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pgconn/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ func configTLS(settings map[string]string, thisHost string, parseConfigOptions P
844844
decryptedKey, decryptedError = x509.DecryptPEMBlock(block, []byte(sslpassword))
845845
// Should we also provide warning for PKCS#1 needed?
846846
if decryptedError != nil {
847-
return nil, fmt.Errorf("unable to decrypt key: %w", err)
847+
return nil, fmt.Errorf("unable to decrypt key: %w", decryptedError)
848848
}
849849

850850
pemBytes := pem.Block{

0 commit comments

Comments
 (0)