How to connect to PostgreSQL/Amazon Redshift using SSL without validating the server certificate?

How to connect to PostgreSQL/Amazon Redshift using SSL without validating the server certificate?

book

Article ID: KB0079313

calendar_today

Updated On:

Products Versions
Spotfire Server 7.0.x and later

Description

How to connect to PostgreSQL/Amazon Redshift using SSL without validating the server certificate?​
 

Issue/Introduction

How to connect to PostgreSQL/Amazon Redshift using SSL without validating the server certificate?

Resolution

Append '?ssl=true;sslfactory=org.postgresql.ssl.NonValidatingFactory' at the end of the connection URL. This will make the driver to enable SSL and to use the NonValidatingFactory.

Here is a sample connection URL:
 
<connection-url-pattern>jdbc:postgresql://host:port/database?tcpKeepAlive=true?ssl=true;sslfactory=org.postgresql.ssl.NonValidatingFactory</connection-url-pattern>

Additional Information

https://jdbc.postgresql.org/documentation/91/ssl-client.html
https://jdbc.postgresql.org/documentation/head/ssl-client.html