Mutual TLS (mTLS) certificate generator
A complete mutual TLS bundle: one CA, one server certificate, and up to 10 client certificates — each also exported as a password-protected PKCS#12 file ready for browsers and operating systems. Everything runs in your browser; nothing is uploaded.
One CA, one server certificate and up to 10 client certificates, each with a downloadable .p12 bundle for browsers and operating systems.
Use ASCII characters for the CA name.
— or paste the PEM below —
— or paste the PEM below —
Files are read locally in your browser and never uploaded.
Separate entries with commas or spaces. The Common Name is always added automatically.
Clients are named client-1, client-2, … Each gets a certificate, a private key and a .p12 bundle containing the client certificate, its key and the CA certificate. Use letters, digits, dots, hyphens and underscores only.
Client certificates
How to enable mutual TLS in Nginx
1. Install the server side
sudo mkdir -p /etc/nginx/ssl sudo cp server.crt ca.crt /etc/nginx/ssl/ sudo cp server.key /etc/nginx/ssl/server.key sudo chmod 600 /etc/nginx/ssl/server.key
2. Require a client certificate
server {
listen 443 ssl http2;
server_name example.com;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
# CA that signed the client certificates
ssl_client_certificate /etc/nginx/ssl/ca.crt;
ssl_verify_client on;
ssl_verify_depth 2;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_session_cache shared:SSL:10m;
location / {
proxy_set_header X-Client-DN $ssl_client_s_dn;
proxy_set_header X-Client-Verify $ssl_client_verify;
proxy_pass http://127.0.0.1:8080;
}
}
Use ssl_verify_client optional instead of on if you want to accept both regular visitors and authenticated clients, then check $ssl_client_verify in your application.
3. Test and reload
sudo nginx -t sudo systemctl reload nginx
4. Connect as a client
# PEM certificate + key curl --cacert ca.crt --cert client-1.crt --key client-1.key https://example.com/ # PKCS#12 bundle curl --cacert ca.crt --cert-type P12 --cert client-1.p12:changeit https://example.com/
5. Install a client bundle on your computer
Double-clicking a .p12 file imports the client certificate and its key together; enter the export password when prompted.
- Double-click
client-1.p12to start the Certificate Import Wizard. - Choose Current User (or Local Machine for services), then Next.
- Enter the export password and tick Mark this key as exportable if you may move it later.
- Select Automatically select the certificate store → Next → Finish.
- Chrome and Edge will now offer this certificate when a site requests one. Verify under Settings → Privacy and security → Security → Manage device certificates.
Command line equivalent:
certutil -importpfx -user -p changeit client-1.p12 certutil -store -user My
- Double-click
client-1.p12— Keychain Access opens. - Choose the login keychain (or System for machine-wide use) and click Add.
- Enter the export password to unlock the bundle.
- The certificate and private key appear together under My Certificates.
- Safari and Chrome will offer it for mTLS sites. Verify with
security find-identity -p ssl-client.
Command line equivalent:
security import client-1.p12 -k ~/Library/Keychains/login.keychain-db \ -P changeit -T /usr/bin/curl security find-identity -p ssl-client
Most Linux tools read PEM directly, so client-1.crt + client-1.key are usually enough:
curl --cacert ca.crt --cert client-1.crt --key client-1.key https://example.com/ openssl s_client -connect example.com:443 -CAfile ca.crt \ -cert client-1.crt -key client-1.key
To import the .p12 into Firefox or Chrome (both use the NSS store on Linux):
# Firefox / Chrome share the NSS database pk12util -i client-1.p12 -d sql:$HOME/.pki/nssdb -W changeit certutil -L -d sql:$HOME/.pki/nssdb
Extract PEM files from a bundle with openssl if needed:
openssl pkcs12 -in client-1.p12 -clcerts -nokeys -out client-1.crt -passin pass:changeit openssl pkcs12 -in client-1.p12 -nocerts -nodes -out client-1.key -passin pass:changeit
6. Trust the CA so clients accept the server
Clients still need ca.crt in their trust store, otherwise they will reject the server certificate.
- Double-click
ca.crt, then choose Install Certificate…. - Select Local Machine → Next (confirm the UAC prompt).
- Choose Place all certificates in the following store → Browse…
- Pick Trusted Root Certification Authorities → Next → Finish.
certutil -addstore -f "ROOT" ca.crt certutil -store ROOT
- Double-click
ca.crt— Keychain Access opens. - Drag it into the System keychain under Certificates.
- Double-click it, expand Trust, and set When using this certificate to Always Trust.
sudo security add-trusted-cert -d -r trustRoot \ -k /Library/Keychains/System.keychain ca.crt
Debian / Ubuntu / Mint
sudo cp ca.crt /usr/local/share/ca-certificates/my-root-ca.crt sudo update-ca-certificates
RHEL / CentOS / Fedora / Rocky / AlmaLinux
sudo cp ca.crt /etc/pki/ca-trust/source/anchors/my-root-ca.crt sudo update-ca-trust extract
Arch / Manjaro
sudo trust anchor --store ca.crt
Verify
openssl verify -CAfile ca.crt server.crt openssl verify -CAfile ca.crt client-1.crt
Also try: Self-Signed Certificate Generator · Private CA Certificate Generator · CSR Generator · Certificate Decoder