Skip to content

Commit f97df82

Browse files
committed
mTLS Instructions
1 parent 9396af7 commit f97df82

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,30 @@ curl -s -k -X POST -d 'cauliflower' http://localhost:8080/a/b/c?response_body_on
201201

202202
The output will be 'cauliflower'.
203203

204+
## Client certificate details (mTLS)
205+
206+
There's also an HTTPS server that requests client certificates (also known as mTLS), listening on port 8444 by default.
207+
208+
```bash
209+
docker run -p 8444:8444 --rm -t mendhak/http-https-echo:25
210+
```
211+
212+
You can then call it with curl passing a certificate and key. The client certificate will not be validated.
213+
214+
```bash
215+
curl -k --cert cert.pem --key privkey.pem https://localhost:8444/
216+
```
217+
218+
The response body will contain details about the client certificate passed in.
219+
220+
You can change the port by using the `HTTPS_MTLS_PORT` environment variable.
221+
222+
```bash
223+
docker run -e HTTPS_MTLS_PORT=3333 -p 3333:3333 --rm -t mendhak/http-https-echo:25
224+
```
225+
226+
If you browse to https://localhost:8444/ in Firefox, you should get prompted to supply a client certificate as long as you have [an imported certificate by the same issuer as the server](https://superuser.com/questions/1043415/firefox-doesnt-ask-me-for-a-certificate-when-visiting-a-site-that-needs-one). If you need browser prompting to work, you'll need to follow the 'use your own certificates' section.
227+
204228

205229
## Output
206230

0 commit comments

Comments
 (0)