title: Java send https request to a server
body: <p>I have a java application dat sends https request to my server. I had to create a keystore with:</p>
  
  <pre><code>keytool -import -file mycert.cer -alias myalias -keystore keystore.jks
  </code></pre>
  
  <p>and use that as truststore in my java app. But the certificate on my server is valid for one year. After one year the certificate changes. </p>
  
  <p>So does it mean I have to generate a new keystore when that happens? Or are there better ways of achieving this?</p>