Client certificate authentication



I’m trying to configure my Apache server to require client provide a SSL certificate in order to gain access to the site. I have the setup working with self-signed certificates, but when I switched over to LE, I’m having a hard time. Could someone please help me out with this? My Apache config looks as follows:

# working configuration with self-signed certs
SSLCertificateFile /etc/ssl/ca/certs/privateTools.crt
SSLCertificateKeyFile /etc/ssl/ca/private/privateTools.key
SSLCertificateChainFile /etc/ssl/ca/certs/privateToolsCA.crt
SSLCACertificateFile /etc/ssl/ca/certs/privateToolsCA.crt

# Not working with LE certs
SSLCertificateKeyFile /etc/letsencrypt/live/
SSLCertificateFile      /etc/letsencrypt/live/
SSLCertificateChainFile /etc/letsencrypt/live/
#SSLCACertificateFile    /etc/letsencrypt/live/

# validate SSL Certificate
SSLProtocol -all +TLSv1 +SSLv3

SSLProxyEngine off

<Directory /srv/websites/phpldapadmin>
    SSLOptions +StrictRequire
    Satisfy any
    SSLVerifyClient require

I guess I have 2 questions here…

  1. What do I specify for the SSLCACertificateFile
  2. How do get a client certificate and how do I sign it?

Thank you very much for the help!


Your questions are a bit out of scope for this site, but I’ll try to provide some links.

This will contain CAs that you allow for verification of certificates provided by the client. It’s just a plain text file with PEM-encoded certificates for CA roots.

Outside LE territory here. You can go to a registrar that sells client certificates, make your own CA and sign certificate requests yourself, or anything similar.

For Apache HTTPd, you’ll probably want to look at SSLVerifyClient along with SSLRequire or the newer replacement Require expr.


As far as I know, Let’s Encrypt only issues DV certificates, not client certificates. So for client verification, you’ll probably want to use another CA.

BTW, the CA for client verification (SSLCACertificateFile) doesn’t have to be the same CA as for your server’s certificate (SSLCertificateFile). Those can be different.


Additionally, he’s going to want to use a CA that he himself runs. You can’t trust client certificates issued by anyone else…


thank you for your replies guys!

I didn’t know that validation cert could be different! Got my setup working again! So, I’m using the LE certs to secure my site and self-signed cert for authentication.

Thanks a lot for the help!


Can you please share your setup as I also want to do the same.


Hello Michelde,

Here’s my config:

<VirtualHost *:443>
Some other directives go here

SSLEngine On

SSLProtocol -all +TLSv1 +SSLv3

SSLCertificateFile /etc/ssl/ca/certs/server.crt
SSLCertificateKeyFile /etc/ssl/ca/private/server.key
SSLCACertificateFile /etc/ssl/ca/certs/serverCA.crt
SSLVerifyClient optional

SSLProxyEngine Off

ProxyRequests Off

<Location />
    Order deny,allow
    Deny from all

    Satisfy any
    Allow from

    # this block is used to avoid forcing a cert if i'm on my local network
    RewriteEngine on
    RewriteCond %{REMOTE_ADDR} !^192.168.1.[0-9]*$
    RewriteRule   ^  -  [F]
<Location />

I hope this helps!




The old crypto features in that configuration look rather scary to me. I’d like to make a plug for

to update the cryptographic parameters there.


That looks interesting. Thanks!


[quote=“dimaj, post:7, topic:6552”]
[/quote]SSLCACertificateFile and SSLCertificateFile shouldt be same ? pls suggest


Correct, the SSLCACertificateFile is your CA that is used to sign client certificates.
I found this guide very helpful: