title: Tomcat8.5 SSL connector with goDaddy certificate
body: <p>I had followed the instruction to generate the key and certificate.  I was able to import the certificate successfully.  I can't get the connector correctly.  </p>
  
  <p>Here are the steps and the messages.  </p>
  
  <ol>
  <li><p>Generating Key</p>
  
  <pre><code>keytool -genkey -alias server -keyalg RSA -keysize 2048 -keystore myKey.jks -dname "CN=dnsName.com
  </code></pre></li>
  <li><p>Generate Certificate Signing Request.</p>
  
  <pre><code>keytool -certreq -alias server -file myCSR.csr -keystore myKey.jks 
  </code></pre></li>
  <li><p>Download certificate from CA: copy myCSR content, past into goDaddy, and download 3 files: <code>serialNumber-root.crt</code>, <code>bundle-intermediate.crt</code>, <code>*.pem</code></p></li>
  <li><p>Tomcat Web Server SSL Certificate Installation:</p>
  
  <pre><code>keytool -import -alias root -keystore myKey.jks -trustcacerts -file serialNumber-root.crt
  keytool -import -alias intermed -keystore myKey.jks -trustcacerts -file bundle-intermediate.crt
  keytool -import -alias tomcat -keystore myKey.jks -trustcacerts -file serialNumber-root.crt
  </code></pre></li>
  </ol>
  
  <p>Everything is successful at this point.</p>
  
  <ol start="5">
  <li>Modify <code>tomcat/conf/server.xml</code></li>
  </ol>
  
  <p>a. gives me <code>java.lang.Exception: Unable to load certificate key E:\tomcat\certificate\myKey.jks (error:0906D06C:PEM routines:PEM_read_bio:no start line)</code></p>
  
  <pre><code>&lt;Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
             maxThreads="150" SSLEnabled="true" &gt;
      &lt;UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /&gt;
      &lt;SSLHostConfig&gt;
          &lt;Certificate certificateKeyFile="E:\tomcat\certificate\myKey.jks"
                       certificateFile="E:\tomcat\certificate\serialNumber-root.crt"
                       certificateChainFile="E:\tomcat\certificate\serialNumber-root.crt"
                       type="RSA" /&gt;
      &lt;/SSLHostConfig&gt;
  &lt;/Connector&gt;
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>&lt;Connector port="8443" scheme="https" secure="true" SSLEnabled="true" 
      SSLCertificateFile="E:\tomcat\certificate\serialNumber-root.crt" 
      SSLCertificateKeyFile="myKey.jks" 
      SSLPassword="password" 
      SSLCertificateChainFile="E:\tomcat\certificate\serialNumber-root.crt" 
      keyAlias="server" SSLProtocol="TLSv1"/&gt;
  </code></pre>
  
  <p>b. gives me <code>java.lang.IllegalArgumentException: java.io.IOException: Alias name [server] does not identify a key entry</code></p>
  
  <pre><code>&lt;Connector 
         port="8443" maxThreads="200"
         scheme="https" secure="true" SSLEnabled="true"
         keystoreFile="E:\tomcat\certificate\myKey.jks" 
         keystorePass="password"
         keyAlias="server"
         clientAuth="false" sslProtocol="TLS"
  /&gt;  
  </code></pre>
  
  <p>c. <code>java.lang.IllegalArgumentException: Illegal character in opaque part at index 2: c:\certificate\myKey.jks</code></p>
  
  <pre><code>&lt;Connector port="8443" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" 
          maxSpareThreads="150" scheme="https" secure="true" SSLEnabled="true" 
          clientAuth="false" sslProtocol="TLS" keyAlias="server" 
          keystoreFile="c:\certificate\myKey.jks" 
          keystorePass="password" /&gt;  
  </code></pre>