Forum Discussion

mogranovitch's avatar
mogranovitch
Occasional Contributor
6 years ago

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!

 

  • 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

  • Hi all,

     

    Thank you for your reply, MarcusJ!

     

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

  • 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

    • Olga_T's avatar
      Olga_T
      SmartBear Alumni (Retired)

      Hi all,

       

      Thank you for your reply, MarcusJ!

       

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

      • marEMR's avatar
        marEMR
        Occasional Visitor

        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?