Monday, April 8, 2019

PostgreSQL JDBC + SSL

This serves as a note to myself (and anyone else) on a simple way to connect to a SSL-enable PostgreSQL (9.4+) server using the standard java SSL properties:

Add sslfactory=org.postgresql.ssl.DefaultJavaSSLFactory to your connection string, and configure your JVM javax.net.ssl.* properties as you would for the majority of java applications.

E.g.:

jdbc:postgresql://dbhost:5432/testdb?ssl=true&sslmode=verify-ca&sslfactory=org.postgresql.ssl.DefaultJavaSSLFactory

and, if you use PKCS12 for certificate storage:

java -Djavax.net.ssl.keyStoreType=PKCS12 -Djavax.net.ssl.keyStore=/path/to/cert.p12 -Djavax.net.ssl.keyStorePassword=notapassword -Djavax.net.ssl.keyAlias=mycert -Djavax.net.ssl.trustStore=/path/to/truststore.p12 -Djavax.net.ssl.trustStoreType=PKCS12 -Djavax.net.ssl.trustStorePassword=notapassword



1 comment:

  1. If this is your first time on our site, these associated articles will allow you to enjoying in} slots online. Picking a great slot machine to play, you will improve your possibilities. Of all of the trick to successful on slot machines, finding dafabet the most effective slot machine to play is the one secret all probably the most skilled gamers swear by. With over 7,000 slot machines, Yaamava’ Resort & Casino has probably the most gaming options of any on line casino in the West. You’ll have the chance to try out the most recent games available on the market, nicely as|in addition to} all of your favorite classics all on one floor.

    ReplyDelete

Disney's Cloudy Vision - Part 1

Today's Disney has the idea backwards: Disney Parks should be imagined as places where a particular character/IP would live, not create ...