keytool -genkey -alias wiremock -keyalg RSA -keysize 1024 \
-validity 365 -keypass password -keystore identity.jks -storepass password
Important: keypass
must equal storepass
, or else you'll receive java.io.IOException: !JsseListener: java.security.UnrecoverableKeyException: Cannot recover key
java -jar wiremock-1.54-standalone.jar --https-port 8081 --https-keystore ./identity.jks
Run java with -Djavax.net.ssl.trustStore=/path/to/identity.jks
and calls to https://localhost
will succeed :-)
keytool -list -v -keystore keystore -alias wiremock
- https://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html
- https://confluence.atlassian.com/pages/viewpage.action?pageId=424313691
- https://blogs.oracle.com/blogbypuneeth/entry/steps_to_create_a_self
- http://wiremock.org/running-standalone.html