Skip to content

Commit 701f95e

Browse files
committed
Add caddy server configuration for Client Authentication (X509)
1 parent 8497373 commit 701f95e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

security.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,31 @@ and to expose the certificate's DN to the Symfony application:
12531253
# pass the DN to the application
12541254
SSLOptions +StdEnvVars
12551255
1256+
.. code-block:: caddy
1257+
1258+
tls {
1259+
client_auth {
1260+
mode verify_if_given # Please refer to the Caddy documentation for more information
1261+
trusted_ca_cert_file /path/to/my-custom-CA.pem
1262+
}
1263+
}
1264+
1265+
route {
1266+
# Other configuration options go here
1267+
1268+
php_fastcgi unix//var/run/php/php-fpm.sock {
1269+
env SSL_CLIENT_S_DN {http.request.tls.client.subject}
1270+
1271+
# Environment variables for other certificate fields that you might need
1272+
# They are not used by Symfony, but you can use them in your application
1273+
env SSL_CLIENT_S_FINGERPRINT {http.request.tls.client.fingerprint}
1274+
env SSL_CLIENT_S_CERTIFICATE {http.request.tls.client.certificate_der_base64}
1275+
env SSL_CLIENT_S_ISSUER {http.request.tls.client.issuer}
1276+
env SSL_CLIENT_S_SERIAL {http.request.tls.client.serial}
1277+
env SSL_CLIENT_S_DN {http.request.tls.client.subject}
1278+
}
1279+
}
1280+
12561281
Then, enable the X.509 authenticator using ``x509`` on your firewall:
12571282

12581283
.. configuration-block::

0 commit comments

Comments
 (0)