Hi, We have our ubuntu server in Digital Ocean and our postgresql database is AWS RDS. Our app is nodejs based and we are using pg-native module for postgres interface from nodejs. When we try connecting using psql, it is working fine, but when we try using pg-native connectSync api, the error is “port 5432 failed: certificate could not be obtained: no SSL error reported”. We are using pg-native and sync variants of api as we need synchronous execution. Request the community help in resolving this. Thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Hi there,
There are a few things that I could suggest here:
Make sure your connection string is properly configured to use SSL. You might want to include
sslmode
and other related options:Sometimes, the issue might be related to an outdated version of
pg-native
or the underlyinglibpq
library. Update them to the latest stable version if they’re not already updated.You may need to include the AWS RDS SSL root certificate in your connection configuration. You can download the RDS root certificate from the Amazon documentation.
Here is an example of how you might include it in your connection:
If this still does not work, can you share the Node.js code snippet that you are using to establish the connection?
Alternatively, I could suggest using a Managed Postgres Database with DigitalOcean instead of an AWS RDS instance. This would also benefit the speed of your application as it will reduce the network latency for every single database connection that your application will make.
Best,
Bobby