One-way TLS: what HTTPS already proves
When a browser opens an HTTPS site, the TLS handshake does two things: it agrees on encryption keys, and the server proves its identity with a certificate signed by an authority the browser trusts. The browser checks that the certificate is valid, unexpired and issued for the hostname it asked for.
Notice what is missing: the server learns nothing about the client. Anyone on the internet can complete that handshake. Who the client is gets settled later, inside the HTTP request — a password, a session cookie, an API key, a token. For a public website that is exactly right: you want everyone to be able to connect.
Mutual TLS: both sides show a certificate
In mutual TLS (mTLS) the server asks for a certificate in return. During the handshake it names the authorities it accepts; the client answers with its own certificate and proves it holds the matching private key by signing part of the handshake. The server checks the chain against the authorities it trusts and, if anything is wrong — no certificate, an unknown issuer, an expired one — ends the handshake.
That is where the value of mTLS lies: a client without the right certificate never gets to send an HTTP request. There is no login page to guess at, no endpoint to probe, no request for an application bug to parse. The check happens before your application runs.
mTLS does not replace authorization. It tells you which client is connecting; your application still decides what that client may do. And because the identity lives in a certificate, the whole scheme rests on the client's private key staying private.
Certificates and certificate authorities
Client certificates are rarely bought from a public authority. Usually an organisation runs its own private CA: a root certificate kept offline and an intermediate that signs client certificates day to day. The server is given that CA's certificates — a CA bundle — and accepts any client certificate that chains up to them.
Trusting a CA means trusting everything it signs, so a careful server checks one more thing: the name in the certificate, the subject's CN or a SAN entry. When one CA issues certificates to several clients, the name is what tells them apart.
Two practical rules follow. Pin the name, not the fingerprint: certificates get renewed, and the fingerprint changes with every renewal while the name stays the same. And automate renewal: short-lived certificates renewed by a machine are safer than long-lived ones someone has to remember.
Where mTLS is worth it
Service to service. Inside a platform, services authenticate each other with certificates instead of shared passwords; service meshes do this automatically.
Partner and B2B APIs. A bank, a payment provider or a logistics partner gives each client its own certificate, and the API accepts only those.
Devices. Kiosks, terminals and IoT devices carry a certificate issued at enrolment, so a leaked API key alone is not enough.
Your origin behind a CDN. Visitors talk to the CDN; only the CDN should talk to your origin. When the edge presents a client certificate and your origin requires it, requests that try to go around the CDN — and around its WAF and rate limits — are refused during the handshake. This is usually called authenticated origin pull.
Requiring a client certificate in nginx
On the server side, mTLS is a handful of lines. nginx needs the CA bundle to trust, the instruction to require a certificate, and preferably a check on the name, as in the example below.
ssl_verify_client on refuses a handshake without a valid certificate; nginx answers such requests with 400 Bad Request ("No required SSL certificate was sent"). ssl_verify_depth 2 allows a root plus an intermediate. The if block then accepts only the expected name, so a certificate from the same CA issued to someone else gets a 403.
To test from a client, pass a certificate and its key to curl: curl --cert client.crt --key client.key https://origin.example.com/. The same request without --cert and --key must be refused.
nginx: require a client certificate and check its name
server {
listen 443 ssl;
server_name origin.example.com;
ssl_certificate /etc/nginx/tls/origin.crt;
ssl_certificate_key /etc/nginx/tls/origin.key;
# trust client certificates signed by this CA, and require one
ssl_client_certificate /etc/nginx/tls/client-ca.pem;
ssl_verify_client on;
ssl_verify_depth 2;
# accept only the expected name
if ($ssl_client_s_dn !~ "(^|,)CN=client\.example\.com(,|$)") {
return 403;
}
}
Authenticated origin pull on cdn.com.tr
On cdn.com.tr, authenticated origin pull is a card on your account's Origin page. With it on, our edge servers present a client certificate whenever they connect to your origin, and you choose which one.
CDN.com.tr certificate — on every paid plan. Every edge presents CN=origin-pull.cdn.com.tr, which proves that a request comes from CDN.com.tr's edge servers. Pair it with a secret origin header whose name and value you choose and add to your delivery rules; your origin checks both, and the header tells your requests apart.
Certificate for this account only — on Enterprise plans. The certificate's name is your account ID, so an origin that accepts only that name accepts only your account.
The card gives you the CA bundle to download (cdn-com-tr-origin-pull-ca.pem) and the exact name to accept. Your origin needs an HTTPS port of its own, different from its HTTP port: with the setting on, the edges connect to it over HTTPS for every visitor, HTTP visitors included. The edges' certificates are renewed automatically with the same name, so a check on the name keeps passing, and image optimization keeps working because our optimization servers present the same certificate when they fetch your originals. The edges can also verify your origin's certificate, so the trust runs both ways. The authenticated origin pull guide has the nginx, Apache, Caddy and IIS settings.
Rolling it out without locking yourself out
The order matters, because a server that requires a certificate refuses everyone who does not present one yet.
1. HTTPS on the origin. Make sure your origin answers HTTPS on its own port and that the CDN already reaches it.
2. Certificate on the edge. Choose the client certificate in the panel and wait until it is active on the edges.
3. Configuration on the origin. Install the CA bundle and write the configuration with the name check, without enforcing it yet.
4. Enforce. Only now switch the requirement on and reload the web server.
5. Test both ways. A request through the CDN returns 200; a request straight to the origin without a certificate is refused.
If steps 2 and 4 are swapped, the origin refuses the edge: nginx answers 400, while Apache, Caddy and IIS close the connection, which visitors see as a 502 Bad Gateway.
Who relies on mTLS
Each partner connects with a certificate issued to it, and every other client is refused before the API reads a byte.
Kiosks, terminals and sensors carry their own certificate, so a leaked API key alone opens nothing.
The origin accepts only connections that present the CDN's certificate, so nobody can go around the WAF and rate limits.
How to set it up
Step-by-step guides in the help centre:
mTLS FAQ
What is the difference between TLS and mTLS?
In TLS only the server presents a certificate, so the client knows who the server is. In mTLS the client presents one too, so the server also knows who the client is, and refuses clients without a valid certificate during the handshake.
Is mTLS the same as an API key?
No. An API key travels inside the request and can be copied from a log or a config file. An mTLS client proves it holds a private key that never crosses the network. Many APIs use both: mTLS for which client is connecting, a key or token for what it may do.
Do browsers support client certificates?
Yes, but it is awkward for the public: users have to install a certificate and pick it from a dialog. That is why mTLS is used between machines and on managed devices rather than for ordinary website visitors.
Do I still need a secret header with authenticated origin pull?
With the CDN.com.tr certificate, yes: the certificate proves the request comes from CDN.com.tr, the secret header proves it comes from your account. With the account certificate on Enterprise plans, the name check alone already accepts only your account; keeping the header as well does no harm.
What happens when the client certificate is renewed?
If your server checks the name (CN) rather than the fingerprint, nothing. On cdn.com.tr the edges' certificates are renewed before they expire, from the same CA and with the same name.
Why does my origin answer 400 after I switched mTLS on?
nginx answers 400 when a required client certificate was not sent. Usually the requirement was switched on before the edges presented the certificate, or the request did not come through the CDN. Check that the panel shows the certificate as active on the edges, then test again.