Skip to content

Instantly share code, notes, and snippets.

@xdu
xdu / certificateKeytool.md
Last active June 9, 2021 14:15 — forked from dahernan/certificateKeytool.txt
generate self signed certificate with keytool

To generate a self-signed SSL certificate using the keytool command on Windows, Mac, or Linux:

  • Open a command prompt or terminal.

  • Run this command:

    keytool -genkey -keyalg RSA -alias tomcat -keystore selfsigned.jks \ -validity -keysize 2048

Where <days> indicate the number of days for which the certificate will be valid.