Use java keytool to create a self signed SSL certificate

Certificate
Run:

keytool.exe -genkey -keyalg RSA -alias ssl -keystore ssl.jks -storepass #### -validity 36000 -keysize 2048 -ext SubjectAlternativeName=dns:localhost -ext KeyUsage:critical=KeyEncipherment,digitalSignature -ext ExtendedKeyUsage=serverAuth

Then, to export the certificate:

keytool.exe -export -alias ssl -keystore ssl.jks -rfc -file x509.cer

Post a Comment

Previous Post Next Post