I would like to be able to connect to a MySQL server with JDBC through an SSL connection. The MySQL documentation states that we should set system properties:
java
System.setProperty("javax.net.ssl.trustStore","path_to_truststore_file");
System.setProperty("javax.net.ssl.trustStorePassword","password");
Indeed, it works... for MySQL. But once I've set those system properties, I cannot make regular HTTPS calls to registered websites. The system trustore has been overriden, and I get an SSLHandshakeException.
I'd like to be able to set the trustore ONLY for the JDBC MySQL connection. Any regular HTTPS call should use the system trust store.
How can it be done ?
I have found this question that may lead to an answer but it looks like it's not working.