1
votes

I have a Karaf program with the following components:

  1. Karaf 4.0.7;
  2. Hibernate 4.3.7;
  3. Mysql JDBC Connector 5.1.27;
  4. C3P0 0.9.5.

I just set up a new development environment where I'm using Mysql 8.0.11 (released only recently). I already locally upgraded my Mysql Connector to 5.1.46 so it's compatible with Mysql 8, and it mostly works. However, I'm getting some warnings in my Karaf console about SSL:

Wed Apr 25 09:28:29 CEST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

I'd like to disable SSL locally, but the recommended suggestion of adding &useSSL=false to the end of the connection string doesn't work. This is my connectionstring:

hibernate.connection.url=jdbc:mysql://localhost:3306/dbname?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&requireSSL=false

What am I doing wrong?

1

1 Answers

0
votes

After coming across MySql & Hibernate SSL Connection, I figured out that the useSSL and requireSSL properties in this case shouldn't be added to the jdbc url like they would be if using a Tomcat webapp.xml file (as I originally thought it would work), but rather added as separate hibernate.connection.useSSL and hibernate.connection.requireSSL properties.

usage:

hibernate.connection.useSSL=false
hibernate.connection.requireSSL=false

Adding these 2 lines to my hibernate.properties file in karaf removed the warnings.