title: MySql & Hibernate SSL Connection
body: <p>I am using MySql &amp; Hibernate and wish to connect with SSL</p>
  
  <p>I have created truststore.jks (I also have pem files for certificates and keys if they are required, but I'd rather use just the truststore if it is possible)</p>
  
  <p>I have the following connection string</p>
  
  <blockquote>
    <p>"jdbc:mysql://localhost:3306/mydb?verifyServerCertificate=true&amp;useSSL=true&amp;requireSSL=true"</p>
  </blockquote>
  
  <p>and I am using </p>
  
  <blockquote>
    <p>"javax.net.ssl.trustStore"</p>
  </blockquote>
  
  <p>to set the path to the truststore</p>
  
  <p>I am also using a username and password </p>
  
  <p>it also works using or not using </p>
  
  <p>"javax.net.ssl.trustStorePassword"</p>
  
  <p>and have added</p>
  
  <blockquote>
    <p>"hibernate.connection.requireSSL" and "hibernate.connection.useSSL"</p>
  </blockquote>
  
  <p>if I remove the truststore, it still connects fine, but if I leave just the truststore it doesn't work. so how do I know it really is connected by ssl? do I still need the username and password? how do I know the truststore is actually being used?</p>
  
  <p>thanks in advance for helping me keep my hair on my head</p>