title: How to use p12 certificate in Eclipse?
body: <p>I am getting following error while accessing the our server..</p>
  <p>javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure</p>
  <pre><code>I have a .p12 certificate..
  </code></pre>
  <p>When i give the path of the ssl certificate and password in Soap UI. it is working perfectly.. I wanted to do it in Java/Eclipse</p>
  <p><a href="https://jackstromberg.com/2013/05/importing-a-ssl-certificate-into-a-java-keystore-via-a-pkcs12-file/" rel="nofollow noreferrer">https://jackstromberg.com/2013/05/importing-a-ssl-certificate-into-a-java-keystore-via-a-pkcs12-file/</a></p>
  <pre><code>Followed the step 1, 2 and 4 to create keystore and import it..
  
  placed mykeystore and mycertificate in C:\Program Files\Java\jdk1.8.0_261\jre\bin
  while importing I am getting following message..
  
  C:\Program Files\Java\jdk1.8.0_261\jre\bin&gt;keytool -v -importkeystore -srckeystore mycertificate.p12 -srcstoretype PKCS12 -destkeystore mykeystore -deststoretype JKS
  Importing keystore mycertificate.p12 to mykeystore...
  Enter destination keystore password:
  Re-enter new password:
  Enter source keystore password:
  Entry for alias fcs certificate successfully imported.
  Import command completed:  1 entries successfully imported, 0 entries failed or cancelled
  [Storing mykeystore]
  
  Warning:
  The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using &quot;keytool -importkeystore -srckeystore mykeystore -destkeystore mykeystore -deststoretype pkcs12&quot;.
  </code></pre>
  <p>Added the following in eclipse config file</p>
  <pre><code> -Djavax.net.ssl.trustStore=&quot;C:/Program Files/Java/jdk1.8.0_261/jre/lib/security/cacerts&quot;
      -Djavax.net.ssl.trustStorePassword=changeit
  Restarted the eclipse and trying to run that but still getting handshake failure..
  </code></pre>
  <p>Is all my procedure correct?</p>
  <p>When debug enabled.. getting below error</p>
  <pre><code>javax.net.ssl|ALL|01|main|2020-11-09 18:28:51.118 IST|null:-1|No X.509 cert selected for RSA
  javax.net.ssl|WARNING|01|main|2020-11-09 18:28:51.118 IST|null:-1|Unavailable authentication scheme: rsa_pkcs1_sha512
  javax.net.ssl|ALL|01|main|2020-11-09 18:28:51.118 IST|null:-1|No X.509 cert selected for EC
  </code></pre>
  <p>The other way , I tried this as well.</p>
  <p>Exported certificate from the browser..</p>
  <p><a href="https://www.javasavvy.com/import-ssl-certificate-into-java-keystore/" rel="nofollow noreferrer">https://www.javasavvy.com/import-ssl-certificate-into-java-keystore/</a></p>
  <p>still getting same error.</p>