Overview:
I used wiremock standalone 2.1.11 and did the following to enable HTTPS URL for my request but to no avail:
The command for running the wiremock is as follows:
java -jar wiremock-standalone-2.1.11.jar --port 8920 --https-port 8921 --https-keystore /home/wiremock/keystore/clientkeystore --verbose
Note: I can connect via http port correctly
Now I would be grateful if anyone could help me find solution for HTTPS connection.
Generate java key store for wiremock
keytool -genkey -alias wiremock -keyalg RSA -keysize 1024 \
-validity 365 -keypass password -keystore identity.jks -storepass password
Important --- Follow the prompts to specify the certificate details:
Create the self-signed certification
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout localhost.key -out localhost.crt -config localhost.conf
Import certification into keystore
keytool -import -trustcacerts -alias mock -file localhost.crt -keystore identity.jks
Start wiremock with the new keystore and HTTPS enabled
java -jar wiremock-1.54-standalone.jar --https-port 8443 --https-keystore
./identity.jks
Resources:
The answer is from https://gist.github.com/mobmad/433ba54e9cb97d6d7771#1-generate-self-signed-certificate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With