From 62ad20cea7ad840991acdc3405d13dfd81e4f054 Mon Sep 17 00:00:00 2001 From: Thibaut Rousseau Date: Mon, 7 Feb 2022 21:18:18 +0100 Subject: [PATCH] add doc to use HTTPS in dev --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index d4ff379..0929800 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ The documentation is available on [smocker.dev](https://smocker.dev). - [Documentation](#documentation) - [Docker](#docker) - [Caddy](#caddy) + - [HTTPS](#https) - [Authors](#authors) - [Contributors](#contributors) @@ -182,6 +183,24 @@ If you need to test Smocker with a base path, you can use the Caddyfile provided - `make start-release`, `make VERSION=xxx start-release`: create a released version of Smocker and launch it with `/smocker/` as base path - `make start-caddy`: start Caddy to make Smocker accessible at http://localhost:8082/smocker/ +### HTTPS + +If you need to test Smocker with HTTPS enabled, the easiest way is to generate a locally signed certificate with [mkcert](https://github.com/FiloSottile/mkcert): + +```sh +# Install the local certificate authority +mkcert -install + +# Create a certificate for localhost +mkcert -cert-file /tmp/cert.pem -key-file /tmp/key.pem localhost +``` + +Then, start Smocker with TLS enabled, using your generated certificate: + +```sh +./smocker -mock-server-listen-port=44300 -config-listen-port=44301 -tls-enable -tls-cert-file=/tmp/cert.pem -tls-private-key-file=/tmp/key.pm +``` + ## Authors - [Thibaut Rousseau](https://github.com/Thiht)