-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
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
Error: failed to configure TLS (unable to add CA to cert pool) #2132
Labels
Comments
I ran your example.
It works for me. Maybe there is something in the environment? |
I would suggest printing out the environment from within your program and seeing if there is anything unexpected, especially PG* variables. If that doesn't yield anything, I don't know anything else to try besides stepping through with a debugger. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When setting
sslmode=disable
in the connection string, I still encounter an error related to TLS configuration. I am using PostgreSQL 16 with the standard Docker image. The error message is:"Unable to parse config: cannot parse
host=localhost port=5432 dbname=postgres user=postgres password=xxxxx target_session_attrs=read-write sslmode=disable
: failed to configure TLS (unable to add CA to cert pool)"Despite explicitly setting
sslmode=disable
in the connection string, the error persists.To Reproduce
Please run your example with the race detector enabled. For example,
go run -race main.go
orgo test -race
.Expected behavior
The connection should be established without attempting to configure TLS when
sslmode=disable
is set.Actual behavior
The connection attempt fails with the error: "failed to configure TLS (unable to add CA to cert pool)".
Version
The text was updated successfully, but these errors were encountered: