B4J Question Mysql SSL warning

atiaust

Active Member
Licensed User
Longtime User
Hi All,

I moved my Mysql database to new server which has an SSL private certificate and I now get this warning. It doesn't effect my app but I am curious how to fix.

Sat May 27 11:12:53 AEST 2017 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 certifica...

I use below to connect to the Mysql database
B4X:
#AdditionalJar:mysql-connector-java-5.1.39

Anyone have any ideas?

Thanks
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Despite that your server uses SSL, your DB may use or not.

to NOT use it add this line to your connection string: useSSL=false

to USE it add these two lines to your connection string: useSSL=true; requireSSL=true

and you will have to run your code with the following commands.

-Djavax.net.ssl.keyStore=path_to_keystore_file
-Djavax.net.ssl.keyStorePassword=password-Djavax.net.ssl.trustStore=path_to_truststore_file-Djavax.net.ssl.trustStorePassword=password

taken from here:
https://stackoverflow.com/questions...o-connect-to-mysql-over-ssl/14268105#14268105
 
Upvote 0
Top