DEV Community

🔑 Self-signed SSL certificate in Tomcat

Orestis Pantazos on October 23, 2019

Self-signed SSL certificate and add into Java truststore. Step 1: Generate the SSL certificate by running the following command $ keytool -genke...
Collapse
 
satinder2000 profile image
satinder-2000

I ran the instructions above but got stuck-

In step 4 we ran command to generate a selfsigned.jks keystore but in the next step (5), we are using the selfsigned.cer file.

Nevertheless, I tried to import the generated selfsigned.jks but got a
keytool error: java.lang.Exception: Input not an X.509 certificate

Please advise.

Collapse
 
cygnustx profile image
CygnusTX

I know your question was 'forever' ago but some will have this question. The missing step, let's call it Step pre-5, is:

keytool -exportcert -file selfsigned.cer -keystore selfsigned.jks -alias tomcat

Collapse
 
karan_gupta_5d9c7ef078861 profile image
Karan Gupta

Is any aware how to also resolve the issue of not secure from URL of self signed certificate

also I have tried adding certificate in chrome, system mmc but still didn't worked

enabled a chrome setting to trust not valid certificate