-
Notifications
You must be signed in to change notification settings - Fork 94
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
pg with google cloud postgres #79
Comments
Allow me to use some key words to potentially help another unfortunate soul: GCP Cloud SQL SSL TLS Certificate Host Name Well, after hours of digging, the certificates are no longer created with the alternate hosts specifying "google-cloud-project:postgres-instance". Instead they use a goofy DNS entry in the form of "1-<uuid>.<geographical zone>.sql.goog". I'm not sure where this uuid can be found or if it's even predictable. I will be raising the issue with the GCP team soon and may update following. |
So it appears that the real reason that this changed has to do with the node TLS library as documented here. A custom implementation of checkIdentityServer() appears to be the best way to securely use GCP Cloud SQL with node-postgres |
Chapter 3 in my spam here, I have discovered a working solution. ssl.host should be set to "google-cloud-project:postgres-instance" as mentioned originally. Now, because the checkIdentityServer() default implementation changed it must be implemented manually like so:
|
This worked for me. Also found that google started issuing certificates for new instances with |
I received the following reply from GCP support regarding this issue:
Still unclear 1) where this is documented (nowhere that I've been able to find) and 2) how this will work with a Terraform-based setup. |
This issue has been raised a while ago, but we are still struggling with it in 2024. We have Google Cloud PostgreSQL instances that were created before 2023 and therefore suffer from the Has anybody found a way to upgrade the instance to receive a new We are using a standard connection string at the moment: and tried all We know that we can set up new instances and migrate all databases to these new instances, but since it only affects the server CA certificate, this seems overkill. Would be grateful for any suggestions, thanks! |
No, unfortunately.
we managed to workaround it by using a custom implementation of
Older certificates have just |
Thanks for the workaround @evgeny-myasishchev! Unfortunately, we are in a setting where we can just provide environment variables for the DB connection, e.g. either dedicated SSL settings for Unfortunately, callbacks cannot be implemented this way. Interestingly, though, |
Got it working, ref. here: directus/directus#22159 (comment) |
My team has a postgres instance in google cloud, and ran into trouble connecting to the database after upgrading to pg 8.0.3 from 7.x
After reading the changelog, we were able to connect by adding rejectUnauthorized : false in the ssl settings
This raised some red flags with us, and one of the developers found the setting for host in the ssl object, which works as expected
It would be helpful to add this to the documentation page.
The text was updated successfully, but these errors were encountered: