I've never set up SSL/TLS before, it's not working, and I have no idea how to debug it. Intial googling is not turning up options. Here's what i've done:
used openSSL to generate a private key and CSR
openssl req -out CSR.csr -new -newkey rsa:2048 -nodes -keyout privateKey.key
gotten my csr signed and downloaded the certificates from startssl.com (free for first year)
installed the root, intermediate, and my domain cert into the .keystore like:
keytool -import -trustcacerts -alias root -file root.crt -keystore .keystore
keytool -import -trustcacerts -alias intermediate -file intermediate.crt -keystore .keystore
keytool -import -trustcacerts -alias tomcat -file mydomain.crt -keystore .keystore
added the tomcat connector (shown below but i had to remove the xml angle braces or stack overflow wouldnt display it)
Connector SSLEnabled="true" acceptCount="100" clientAuth="false" disableUploadTimeout="true" enableLookups="false" maxThreads="25" port="8443" keystoreFile="/home/ec2-user/.keystore" keystorePass="password" protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https" secure="true" sslProtocol="TLS"
bounced tomcat, server starts successfully and serves http requests
- opened catalina.out to see the following error
java.io.IOException: Alias name tomcat does not identify a key entry
I was advised to create a .pkcs12 file by concatenating the root an intermediate certs and then using the command below
openssl pkcs12 -in mydomain.crt -certfile CA.crt -chain -inkey privateKey.key -out tomcat.p12
Unfortunately this resulted in the following error:
4294956672:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1201: 4294956672:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:374:Type =PKCS12
Then I tried to concatenate the private key, domain, intermediate, and root certificate into one .pem file, and then convert it to a x509
I then tried to use the x509 cert in jks & tomcat but i got the same error
java.io.IOException: Alias name tomcat does not identify a key entry
Reading up on this via google makes me more confused - i read these extremely confident tutorials on how to do this and they appear to have been dead wrong. Where can I find an accurate guide on how to set this up.