1

I was able to break down the rds-combined-ca-bundle.pem cert file and import each one into the keystore separately. Then I added the -Djavax.net.ssl.trustStore=path_to_truststore_file and -Djavax.net.ssl.trustStorePassword=password into the jvm options. It worked on one application using the jndi configuration such as below:

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/contextname" unpackWAR="true" useNaming="true" swallowOutput="false">
  <Resource removeAbandoned="true"
            removeAbandonedTimeout="60"
            name="jdbc/data" auth="Container"
            type="javax.sql.DataSource"
            maxActive="200"
            maxIdle="60"
            maxWait="20000"
            username="rootuserssl"
            password="rootusersslpassword"
            driverClassName="com.mysql.jdbc.Driver"
            url="jdbc:mysql://myinstance.123456789012.us-east-1.rds.amazonaws.com:3306/dbname?autoReconnect=true&amp;verifyServerCertificate=true&amp;requireSSL=true&amp;useSSL=true"/>
</Context>

However, on one application using HikariCp, it generates an error javax.net.ssl.SSLException: Unsupported record version Unknown-0.0. Below is the configuration.

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/contextnametwo" unpackWAR="true" useNaming="true" swallowOutput="false">
    <Resource name="jdbc/data" auth="Container"
       driverClassName="com.mysql.jdbc.Driver"
      jdbcUrl="jdbc:mysql://myinstance.123456789012.us-east-1.rds.amazonaws.com:3306/dbname?verifyServerCertificate=true&amp;useSSL=true&amp;requireSSL=true"
      factory="com.zaxxer.hikari.HikariJNDIFactory"
      type="javax.sql.DataSource"
      maximumPoolSize="50"
      connectionTestQuery="SELECT 1"
      idleTimeout="300000"
      maxLifetime="600000"
      dataSource.implicitCachingEnabled="true"
      dataSource.cachePrepStmts="true"
      dataSource.prepStmtCacheSize="250"
      dataSource.prepStmtCacheSqlLimit="2048"
      dataSource.useServerPrepStmts="true"
      catalog="dbname"
      username="rootuserssl"
      password="rootusersslpassword"
 />
</Context>

What am I doing wrong on the application that uses HikariCp?

J.Mustang
  • 11
  • 2

1 Answers1

0

Solved this one by using a mariadb connector (https://downloads.mariadb.org/connector-java/) instead of the mysql. Worked like a charm.

J.Mustang
  • 11
  • 2
  • MariaDB JDBC driver just gave me another error: `java.net.SocketException: Software caused connection abort: recv failed` – Adam May 10 '17 at 13:47