How to configure spring boot application to use SSL/TLS over MySQL?

后端 未结 2 1407
野性不改
野性不改 2021-02-02 04:30

I set up SSL on my MySQL server.

I generated few certicates for CA (ca.pem, ca-key.pem), for client (client-cert.pem, client-key.pem) and server (server-cert.pem and se

2条回答
  •  梦毁少年i
    2021-02-02 04:53

    You need to add the "*.pem" files (cert and key) in a keystore and the CA in a "truststore".

    This link explains well how to create your own keystore and truststore [link] http://roopindersingh.com/programming/converting-pem-certificates-and-private-keys-to-jks/

    After you have to add in JVM paramaters

    -Djavax.net.ssl.keyStore=/path/to/keystore/keystore.jks
    -Djavax.net.ssl.keyStorePassword=password
    -Djavax.net.ssl.trustStore=/path/to/keystore/truststore.jks
    -Djavax.net.ssl.trustStorePassword=password
    

提交回复
热议问题