title: Using multiple SSL client certificates in Java with the same host
body: <p>In my Java application, I need to connect to the same host using SSL, but using a different certificate each time.  The reason I need to use different certificates is that the remote site uses a user ID property embedded in the certificate to identify the client.</p>
  
  <p>This is a server application that runs on 3 different operating systems, and I need to be able to switch certificates without restarting the process.</p>
  
  <p><a href="https://stackoverflow.com/questions/759603/how-do-i-use-multiple-ssl-certificates-in-java">Another user</a> suggested importing multiple certificates into the same keystore.  I'm not sure that helps me, though, unless there is a way to tell Java which certificate in the keystore to use.</p>