title: Spring Boot app does not start due to SSL error on Boxfuse Dev VM
body: <p>I have a Spring Boot application with following SSL configuration:</p>
  
  <p><em>application.yml</em></p>
  
  <pre><code>server:
    port: 443
    ssl:
      key-store: classpath:keys/${BOXFUSE_ENV}.p12
      key-store-type: PKCS12
      key-alias: mydomain.com
      key-store-password: ${X_KEYSTORE_PASSWORD}
  </code></pre>
  
  <p>The correct environment-specific keystores are present in classpath and accessible after launch, which has been verified by manual launch from console with following PowerShell script:</p>
  
  <p><em>dev.ps1</em></p>
  
  <pre><code>$env:BOXFUSE_ENV="dev"
  $env:X_KEYSTORE_PASSWORD="correctpassword"
  
  java -jar target\myapp-1.0.0.12314.jar
  </code></pre>
  
  <p>After manual start application successfully launches at localhost and available both in production and dev mode with correct certificates.
  Now, I try to launch it in PowerShell as Boxfuse app with following command:</p>
  
  <pre><code>boxfuse run target\myapp-1.0.0.12314.jar -env=dev "-envvars.X_KEYSTORE_PASSWORD=correctpassword"
  </code></pre>
  
  <p>App fails to start with this stacktrace:</p>
  
  <pre><code>vb-c2b995f3 -&gt; 2016-11-17 15:31:56.659 ERROR 636 --- [           main] o.apache.catalina.core.StandardService   : Failed
   to start connector [Connector[HTTP/1.1-443]]
  vb-c2b995f3 -&gt;
  vb-c2b995f3 -&gt; org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-443]]
  vb-c2b995f3 -&gt;  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:158)
  vb-c2b995f3 -&gt;  at org.apache.catalina.core.StandardService.addConnector(StandardService.java:225)
  vb-c2b995f3 -&gt;  at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedC
  onnectors(TomcatEmbeddedServletContainer.java:234)
  ...
  vb-c2b995f3 -&gt; Caused by: java.lang.IllegalArgumentException: java.io.IOException: DerInputStream.getLength(): lengthTag
  =109, too big.
  vb-c2b995f3 -&gt;  at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:103)
  vb-c2b995f3 -&gt;  at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:81)
  ...
  vb-c2b995f3 -&gt; Caused by: java.io.IOException: DerInputStream.getLength(): lengthTag=109, too big.
  vb-c2b995f3 -&gt;  at sun.security.util.DerInputStream.getLength(DerInputStream.java:561)
  vb-c2b995f3 -&gt;  at sun.security.util.DerValue.init(DerValue.java:365)
  vb-c2b995f3 -&gt;  at sun.security.util.DerValue.&lt;init&gt;(DerValue.java:320)
  vb-c2b995f3 -&gt;  at sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:1914)
  </code></pre>
  
  <p>What makes so big difference between the two ways to launch the app? How can I fix it? </p>
  
  <p>UPD: the issue was solved by converting the keystores to JKS format and setting key-store-type to PKCS12.</p>
  
  <p>UPD2: the root cause of the issue is here:
  <a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=60450" rel="nofollow noreferrer">https://bz.apache.org/bugzilla/show_bug.cgi?id=60450</a></p>