cancel
Showing results for 
Search instead for 
Did you mean: 

SSL configuration for connecting to Postgres DB

SOLVED
Highlighted
New Contributor

SSL configuration for connecting to Postgres DB

Hi,

 

I'm using ReadyAPI 2.8 and now have problems connecting our cloud-based DB server with Postgres DB.

 

It was working find untill couple of days ago our Server was changed to accept only requests sent through SSL with valid certificate getting error "org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "xxx.xxx.xxx.xxx", user "xxx", database "XXX", SSL off"

Based on somesuggestions, I tried to add at the end of connection string &ssl=true or &ssl=false - getting same error.

I found how to set keystore for use by SOAP or REST API calls, but do not see instructions for using cert's for JDBC calls. 

Some suggestions I found asking to add my app's IP/Username/etc. to the pg_hba.conf file on DB server. Unfortunately, cloud-based DB server does not have that file.

 

Is there a way to properly configure such connection or to bypass this SSL error?

 

Thank you in advance!

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Moderator

Re: SSL configuration for connecting to Postgres DB

Hi,

 

You can bypass SSL validation in the Postgres JDBC driver by adding this parameter to the jdbc connection string.

 

sslfactory=org.postgresql.ssl.NonValidatingFactory 

 

Regards,

Marcus James

SmartBear Support



Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

Highlighted
Moderator

Re: SSL configuration for connecting to Postgres DB

Hi all,

 

Thank you for your reply, @MarcusJ!

 

@mogranovitch, have you had a chance to try the above suggestion? Does this help?


Olga Terentieva
SmartBear Assistant Community Manager

View solution in original post

3 REPLIES 3
Highlighted
Moderator

Re: SSL configuration for connecting to Postgres DB

Hi,

 

You can bypass SSL validation in the Postgres JDBC driver by adding this parameter to the jdbc connection string.

 

sslfactory=org.postgresql.ssl.NonValidatingFactory 

 

Regards,

Marcus James

SmartBear Support



Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

Highlighted
Moderator

Re: SSL configuration for connecting to Postgres DB

Hi all,

 

Thank you for your reply, @MarcusJ!

 

@mogranovitch, have you had a chance to try the above suggestion? Does this help?


Olga Terentieva
SmartBear Assistant Community Manager

View solution in original post

Highlighted
Occasional Visitor

Re: SSL configuration for connecting to Postgres DB

I have the same issue after upgraded to Ready API 3.1.0 from Ready API 2.8.0 with Postgresql and did added the jdbc connection string as sslfactory=org.postgresql.ssl.NonValidatingFactory but no luck. getting the same error.

Any suggestion?

New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
Let's start July with new challenges!

Create a script to change request body before sending it to the server for the TechCorner tag!


Scripts created in June:
- A script to generate a request body based on data from Datasource
- A script to go through all response nodes and check the value of the required field
- A Dispatching script to get responses based on the values in Request Body
- A script to add a new tag and assign it to all TestCases in a TestSuite
Top Kudoed Authors