title: How to specify certificate's alias name in system property while making a 2way SSL connection?
body: <p>I am trying to run a Java client with 2way SSL, which uses CAC card as keystore for the client. I have added the following system property in my client program to make it work and also changed the <em>java.security</em> file to add <em>pcks11</em> provider.</p>
  <pre><code>System.setProperty(&quot;javax.net.ssl.keyStoreType&quot;, &quot;pkcs11&quot;);
  System.setProperty(&quot;javax.net.debug&quot;, &quot;ssl&quot;);
  </code></pre>
  <p>The program works fine and the handshake is done successfully. However, when I have more than one trusted certificate in the CAC card, it takes the default certificate. I want to specify which certificate should be used to do the client auth (maybe by specifying the alias name), but I didn't find any system property to do that.</p>
  <p>How can I specify the alias name as a system property, so that the 2way SSL will use it for the client auth?</p>
  <p>Is there another way to specify the alias name? For example, when I access the server URL from any browser I would get a certificate selection prompt and the connection is established with the selected certificate.</p>