I found the issue. The jdbc string is correct, but I had an expired certificate on the pgsql server. After I updated the certificate on pgsql, I also had to import the intermediate cert with the java keystore util. Verified OTW encryption is working with tcpdump.