I am trying to configure a Tomcat server using SSL. I created a key pair this way:
$ keytool -genkeypair -alias tomcat -keyalg RSA -keystore keys
Next, I create a certificate signing request:
$ keytool -certreq -keyalg RSA -alias tomcat -keystore keys -file tomcat.csr
I will then tomcat.csr contents of tomcat.csr to the form on the Thawte website, requesting a trial SSL certificate. In return, I get two certificates separated by the symbol -----BEGIN ... -----END , which I save in tomcat.crt and thawte.crt . (Thawte calls the second certificate the certificate "CA Certificate Thawte Test CA").
When I try to import any of them, it fails:
$ keytool -importcert -alias tomcat -file tomcat.crt -keystore keys Enter keystore password: keytool error: java.lang.Exception: Failed to establish chain from reply $ keytool -importcert -alias thawte -file thawtetest.crt -keystore keys Enter keystore password: keytool error: java.lang.Exception: Input not an X.509 certificate
Adding the -trustcacerts parameter to any of these commands does not change anything.
Any idea what I'm doing wrong here?
ssl tomcat pki
lindelof
source share