title: Java keytool won't parse Extensions of my CA certificate
body: <p>I'm currently creating an Android app, which is supposed to send a POST request to a server. Unfortunately, the server is using self-signed certificate. So I have to create a PKCS12 keystore, which will include the CA Certificate, and make my App use that keystore.</p>
  
  <p>To create such a keystore, I'm currently using the command below:</p>
  
  <pre><code>keytool -import -trustcacerts -alias my-alias -file cacert.pem
  -keystore mykeystorefile -storetype PKCS12
  </code></pre>
  
  <p>Unfortunately the keystore doesn't work. (Request fails on SSL handshake.) </p>
  
  <p>When I inspected the keystore using this command:</p>
  
  <pre><code>keytool -list -v -keystore mykeystorefile
  </code></pre>
  
  <p>I noticed a strange line at the very end of this list.</p>
  
  <pre><code>#8: ObjectId: 2.5.29.18 Criticality=false
  Unparseable IssuerAlternativeName extension due to
  java.io.IOException: No data available in passed DER encoded value.
  
  0000: 30 00                                              0.
  
  
  
  *******************************************
  *******************************************
  </code></pre>
  
  <p>Keytool failed to parse an extension, which is part of the CA certificate.</p>
  
  <p>I tried the same for LetsEncrypt's CA certificates and it worked just fine.</p>
  
  <p>I'd be glad for any pointers on how to approach and solve this problem.</p>
  
  <p>Thanks.</p>
  
  <p><strong>Edit:</strong> Keytool I'm currently using is part of java-8-openjdk.</p>
  
  <p><strong>Edit2:</strong> So after inspecting the ca certificate, Issuer Alternative Name extension doesn't have any value. Wondering if there is a way how to skip that extensions?</p>