Skip to content

Secure Connections for JDBC Clients

By default, the PostgreSQL JDBC driver uses the YBSSLMODE or PGSSLMODE environment variable to determine if SSL is going to be used. When SSL is used, the connection uses the root cert file pointed to by the YBSSLROOTCERT environment variable, if specified. If this variable is not specified, the connection uses the default root.cert or root.crt file in the default location (if it exists).

Example: JDBC Connection String

In JDBC, you can set or override the values by specifying the properties in the URL. For example:

jdbc:postgresql://yb14.slc.yellowbrick.io:5432/yellowbrick?sslmode=require&sslrootcert=c:/ybd/star.slc.yellowbrick.io.pem&ApplicationName=JDBC Test SSL

These instructions pertain to the PostgreSQL JDBC driver. If you are using the pgjdbc-ng driver, see http://impossibl.github.io/pgjdbc-ng/docs/current/user-guide/#connection-ssl

Parent topic:Secure Connections for ODBC/JDBC Clients and ybsql