We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pgx.Connect
Describe the bug if i use an empty-file as the sslkey, pgx will panic.
sslkey
To Reproduce create an empty file named key.key then run this program:
key.key
package main import ( "context" "github.com/jackc/pgx/v5" ) func main() { pgx.Connect(context.Background(), "host=localhost sslkey=key.key sslcert=key.crt") }
Expected behavior
pgx.Connect should return an error, if the sslkey is an empty file, it should not panic.
Actual behavior pgx.Connect panics when sslkey is an empty file. A clear and concise description of what actually happened.
Version
go version go1.22.0 darwin/arm64
v5.5.3
Additional context i think the problem is here:
pgx/pgconn/config.go
Lines 723 to 728 in 5c63f64
pem.Decode() will return an error, but it is not checked. then x509.IsEncryptedPEMBlock() panics.
pem.Decode()
x509.IsEncryptedPEMBlock()
The text was updated successfully, but these errors were encountered:
Handle invalid sslkey file
8896bd6
#1915
Fixed in 8896bd6.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
if i use an empty-file as the
sslkey
, pgx will panic.To Reproduce
create an empty file named
key.key
then run this program:
Expected behavior
pgx.Connect
should return an error, if the sslkey is an empty file, it should not panic.Actual behavior
pgx.Connect
panics when sslkey is an empty file.A clear and concise description of what actually happened.
Version
go version go1.22.0 darwin/arm64
v5.5.3
Additional context
i think the problem is here:
pgx/pgconn/config.go
Lines 723 to 728 in 5c63f64
pem.Decode()
will return an error, but it is not checked. thenx509.IsEncryptedPEMBlock()
panics.The text was updated successfully, but these errors were encountered: