Skip to content

Commit 093442c

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

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

security.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,32 @@ 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 {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+
# All placeholders can be found at https://caddyserver.com/docs/caddyfile/concepts#placeholders
1274+
env SSL_CLIENT_S_FINGERPRINT {tls_client_fingerprint}
1275+
env SSL_CLIENT_S_CERTIFICATE {tls_client_certificate_der_base64}
1276+
env SSL_CLIENT_S_ISSUER {tls_client_issuer}
1277+
env SSL_CLIENT_S_SERIAL {tls_client_serial}
1278+
env SSL_CLIENT_S_SERIAL {tls_version}
1279+
}
1280+
}
1281+
12561282
Then, enable the X.509 authenticator using ``x509`` on your firewall:
12571283

12581284
.. configuration-block::

0 commit comments

Comments
 (0)