Skip to content

Instantly share code, notes, and snippets.

View dentys's full-sized avatar

Denis Tyshchenko dentys

View GitHub Profile
@dentys
dentys / wiremock-cert.md
Last active October 13, 2023 12:01
Wiremock with trusted self signed certificate

1. Create a self signed certificate, explicitly specify connection source dns (localhost) name and ip (0.0.0.0).

This allows client to use https://localhost or https://0.0.0.0

keytool -genkey -alias profiler -keyalg RSA -keysize 1024 -validity 1365 -keypass password -keystore wiremock.jks -storepass password -ext SAN=dns:localhost,ip:0.0.0.0

As a result there is a private/public key pair in wiremock.jks keystore

2. Start wiremock with https enabled and custom keystore

Send message to localhost on 30379 port. Can be used to ping Redis server.
(printf "PING\r\n";) | nc localhost 30379