title: How to connect to SQL DB from Java JDBC with mutual TLS/SSL encryption
body: <p>Cloud databases are very prevalent today and sometimes we need to connect to one from a laptop or similar. Usually there is an option for an unencrypted connection but that's not very secure. So how do I connect to a mutual TLS mysql server (like google cloud SQL)?</p>
  
  <p>From mysql cli it's rather straight-forward after downloading the server ca cert, client cert and key from google cloud console:</p>
  
  <pre><code>mysql -u &lt;user-name&gt; -h &lt;server-ip&gt; -p --ssl-ca=server-ca.pem --ssl-cert=client-cert.pem --ssl-key=client-key.pem
  </code></pre>
  
  <p>Note: for Google cloud you can also use the Cloud SQL Proxy but I want to connect without that</p>