0

I have a remote Mysql server running with SSL + Certificate security. I can make a standalone Java JDBC connection work properly using my self-made keystore and truststore.jks . The problem is that I can't find any documentation or website that teaches how to plug into springboot a mysql database that uses SSL + Certificates protection. My application.properties file has this:

spring.jpa.database=MYSQL
spring.datasource.url=jdbc:mysql://{remote-ip}:3306/{database-name}?verifyServerCertificate=true&useSSL=true&requireSSL=true
spring.datasource.username=xxxxxxxx
spring.datasource.password=xxxxxx

spring.jpa.show-sql=true

And inside Eclipse, i have under the JVM-arguments field, this:

-Djavax.net.ssl.trustStore="{path}\truststore.jks" -Djavax.net.ssl.trustStorePassword="xxxxx" -Djavax.net.debug=ssl
-Djavax..net.ssl.keyStore="{path}\keystore"
-Djavax.net.ssl.keyStorePassword="xxxxx"

It won't work. Gives me this error:

java.sql.SQLException: Access denied for user '{database-user}'@'{remote-ip}' (using password: YES)
Moon13
  • 283
  • 1
  • 5
  • 15

0 Answers0