/mtls-example

A server example using mTLS authentication using apache, PHP and docker

Primary LanguageMakefile

mTLS Example

Complete article: https://dev.to/marcointroini/debug-mtls-using-wireshark-7ll

Prerequisites

  • docker desktop
  • curl
  • openssl

Server

Before we must create server and client certificates:

make create_certificates

This will create server (ssl.*) and client certificates inside the certs directory Then it's enough to run

docker-compose up

Client

openssl s_client -connect localhost:443 -status -msg -key certs/client_key.pem -cert certs/client_cert.pem -CAfile certs/ssl.crt -state
curl --location 'https://localhost/server.php' \
--key "./certs/client_key.pem" \
-E "./certs/client_cert.pem" \
--cacert "./certs/ssl.crt"