Skip to content

Commit

Permalink
Handle invalid sslkey file
Browse files Browse the repository at this point in the history
  • Loading branch information
jackc committed Feb 24, 2024
1 parent 85f15c4 commit 8896bd6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pgconn/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,9 @@ func configTLS(settings map[string]string, thisHost string, parseConfigOptions P
return nil, fmt.Errorf("unable to read sslkey: %w", err)
}
block, _ := pem.Decode(buf)
if block == nil {
return nil, errors.New("failed to decode sslkey")
}
var pemKey []byte
var decryptedKey []byte
var decryptedError error
Expand Down

0 comments on commit 8896bd6

Please sign in to comment.