Skip to content
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

OpenSSL 3.2.0 update breaks connections to Aurora Postgres #144

Closed
jasonmccallister opened this issue Nov 26, 2023 · 10 comments · Fixed by #161
Closed

OpenSSL 3.2.0 update breaks connections to Aurora Postgres #144

jasonmccallister opened this issue Nov 26, 2023 · 10 comments · Fixed by #161
Labels
bug Something isn't working

Comments

@jasonmccallister
Copy link
Contributor

Description:

When the container images were updated to include OpenSSL 3.2.0 in #143, subsequent deployments broke Aurora RDS connections to Postgres with the following error:

SQLSTATE[08006] [7] connection to server at "cluster.rds.amazonaws.com" (x.x.x.x), port 5432 failed: SSL error: ssl/tls alert handshake failure connection to server at "cluster.rds.amazonaws.com" (x.x.x.x.), port 5432 failed: FATAL:  no PostgreSQL user name specified in startup packet 

How to reproduce:

  1. Update the container image to include OpenSSL 3.2.0, RDS connection is broken
  2. Lock the specific container image sha to a previous version, connection is restored
@jasonmccallister jasonmccallister added the bug Something isn't working label Nov 26, 2023
@GrahamCampbell
Copy link
Contributor

What version of postgres? Is this postgres aurora? Are you explicitly providing a CA (I know the error indicates that this has nothing to do with this... but I've seen error messages be super misleading with SSL)?

@GrahamCampbell
Copy link
Contributor

GrahamCampbell commented Nov 26, 2023

Are you using week keys? The default security level has changed in openssl 3.2 from 1 to 1: https://www.openssl.org/docs/man3.2/man3/SSL_CTX_set_security_level.html.

@GrahamCampbell
Copy link
Contributor

Are you able to re-build our image with -DOPENSSL_TLS_SECURITY_LEVEL=1 set when building openssl, to see if it fixes the issue?

@GrahamCampbell
Copy link
Contributor

I guess I should also ask - how sure are you at that SSL is actually working before and that the client is not silently falling back to plain text? What happens if you set rds.force_ssl to 1 in the cluster parameter group?

@jasonmccallister
Copy link
Contributor Author

What version of postgres? Is this postgres aurora? Are you explicitly providing a CA

Aurora Postgres 14.6 is the version we are using, we did not provide a CA, using the provided CA from RDS

but I've seen error messages be super misleading with SSL

Completely agree.

Are you using week keys? The default security level has changed in openssl 3.2 from 1 to 1:

We are not using TLS to connect to the RDS database, I suspect that change in OpenSSL to be to root of the cause as we were connected before the update - unable to connect after.

Are you able to re-build our image with -DOPENSSL_TLS_SECURITY_LEVEL=1 set when building openssl, to see if it fixes the issue?

I can certainly try to build the image, that would ultimately verify the issue - I'll try to look into that this week - but no promises :)

I guess I should also ask - how sure are you at that SSL is actually working before and that the client is not silently falling back to plain text?

Our connection string has not changed, only the Bref image. I can look at the param groups in the morning, but nothing changed there either.

@GrahamCampbell
Copy link
Contributor

And you're sure #138 was not the cause?

@mnapoli
Copy link
Member

mnapoli commented Dec 5, 2023

@jasonmccallister is the latest version of the layers working fine now? (if it is, that would pinpoint the problem to the OpenSSL upgrade, if not that might be something else)

@jasonmccallister
Copy link
Contributor Author

@mnapoli we set the deployments to the tagged version 2.2.10 and it has been resolved.

And you're sure #138 was not the cause?

@GrahamCampbell not 100 percent certain, but we did have deployments between those releases without any connectivity issues to RDS.

@GrahamCampbell
Copy link
Contributor

GrahamCampbell commented Dec 7, 2023

This seems to be an issue that has been fixed but not yet released (and won't be released until February 2024): postgres/postgres@5dd30bb. We could apply the patch in bref when we compile libpq, allowing us to upgrade to OpenSSL 3.2, or alternatively, we'd have to wait until postgres 15.6 is released in February.

@mnapoli
Copy link
Member

mnapoli commented Dec 7, 2023

Awesome, thanks for investigating! Let's wait until the patch is released, unless we are missing something big that requires to patch ourselves.

This was referenced Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants