Aug 28, 2017

How to Secure Database Connection From GlassFish/Payara Java EE server to MySQL server

Add the following extra properties:

      <property name="requireSSL" value="true"></property>
      <property name="useSSL" value="true"></property>
      <property name="trustCertificateKeyStorePassword" value="secret1"></property>
      <property name="trustCertificateKeyStoreType" value="JKS"></property>
      <property name="clientCertificateKeyStoreUrl" value="file:////usr/db-ssl/keystore.jks"></property>
      <property name="trustCertificateKeyStoreUrl" value="file:///usr/db-ssl/cacerts.jks"></property>
      <property name="clientCertificateKeyStoreType" value="JKS"></property>
      <property name="clientCertificateKeyStorePassword" value="secret2"></property>
You may need to convert PEM file into JKS.

For windows, you may use file:///c:/path/to/file