title: How to connect to MySQL server using SSL JDBC
body: <p>Hi I am trying to sign in to my MySQL db remotely using java. I created a remote account that requires SSL. I did this by following this guide: <a href="https://www.digitalocean.com/community/tutorials/how-to-configure-ssl-tls-for-mysql-on-ubuntu-16-04" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-configure-ssl-tls-for-mysql-on-ubuntu-16-04</a>. </p>
  
  <p>Now once I am trying to connect to the DB Java throws this error:</p>
  
  <p><code>WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.</code></p>
  
  <p>So I added this to my URL:</p>
  
  <pre><code>       + "&amp;useSSL=true"
        + "&amp;requireSSL=true";
  </code></pre>
  
  <p>But now it requires me to give it a <code>trustStore</code>and a <code>trustStorePassword</code>. Where or how can I find/create these? </p>
  
  <p>My MySQL server is running on a VPS ubuntu server btw.</p>