I have 3 files: SSL CA File, SSL CERT File, SSL Key File. You need to connect to the mysql server via ssl, as is done in MySQL workbench, indicating these files.
Those. You need to somehow transfer the files to the DriverManager.getConnection () method.
I note that there can be many connections to different servers, and each will have their own certificates, so setting global properties
System.setProperty("javax.net.ssl.keyStore","/CERTIFICATES/mysql4/cacert.pem"); properties not suitable. In general, I have a ch. setting properties is not a proxy
System.setProperty("javax.net.ssl.keyStore","c:/Work/ca.pem"); System.setProperty("javax.net.ssl.keyStorePassword","c:/Work/cert"); System.setProperty("javax.net.ssl.trustStore","c:/Work/clint-key.pem"); System.setProperty("javax.net.ssl.trustStorePassword","c:/Work/ca.crt"); Falls:
MESSAGE: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl $ DefaultSSLContext)