Created
July 18, 2017 03:31
-
-
Save robvanoostenrijk/6f88d8248f4e2f86eef920ec39992b17 to your computer and use it in GitHub Desktop.
Java - Generate Self-Signed SSL Certificate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate a self-signed certificate in a Java keystore as a single line command | |
# Note this generates a SAN certificate for machine.domain, localhost & 127.0.0.1 | |
keytool -genkeypair \ | |
-keyalg RSA \ | |
-keysize 2048 \ | |
-alias "machine.domain" \ | |
-keystore /discovery-service/config/keystore.jks \ | |
-keypass "key-password" \ | |
-storepass "store-password" \ | |
-validity 1095 \ | |
-ext san=dns:localhost \ | |
-ext san=ip:127.0.0.1 \ | |
-dname "CN=machine.domain, OU=OrgUnit, O=Org, L=City, ST=State, C=US" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment