This repository sets up a TLS PKI and a couple of Nginx Docker containers to show the use of TLS client certificates with Nginx.
Build the PKI, start the containers and run the tests with make test
# Build the PKI
> make build-pki
> docker-compose up backend
> docker-compose run --rm client bash
This should work.
> curl http://open.backend.test
This should fail because the signing CA is not in the client's trust store.
> curl https://secure.backend.test
This should work.
curl --cacert ./test-ca.pem https://secure.aam.test
This should fail because the signing CA is not in the client's trust store.
> curl https://client.backend.test
This should fail because the client cert is not presented.
curl --cacert ./test-ca.pem https://client.backend.test
This should work.
> curl --cert ./client.pem:password --cacert ./test-ca.pem https://client.backend.test
How to create your own SSL certificate authority Client-side SSL AWS API-Gateway client authentication and Nginx Nginx add client cert
ngx_http_proxy_module
ngx_http_ssl_module
ngx_stream_proxy_module
(not used here but useful if you want to proxy something other than HTTP)