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/gitlab.dimaj.net/privkey.pem
SSLCertificateFile /etc/letsencrypt/live/gitlab.dimaj.net/cert.pem
SSLCertificateChainFile /etc/letsencrypt/live/gitlab.dimaj.net/chain.pem
#SSLCACertificateFile /etc/letsencrypt/live/gitlab.dimaj.net/chain.pem
# validate SSL Certificate
SSLProtocol -all +TLSv1 +SSLv3
SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM
SSLProxyEngine off
<Directory /srv/websites/phpldapadmin>
SSLRequireSSL
SSLOptions +StrictRequire
Satisfy any
SSLVerifyClient require
</Directory>
I guess I have 2 questions here…
What do I specify for the SSLCACertificateFile
How do get a client certificate and how do I sign it?
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.
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.
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.
SSLEngine On
SSLProtocol -all +TLSv1 +SSLv3
SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM
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 192.168.1.0/24
# this block is used to avoid forcing a cert if i'm on my local network
RewriteEngine on
RewriteCond %{SSL:SSL_CLIENT_VERIFY} !^SUCCESS$
RewriteCond %{REMOTE_ADDR} !^192.168.1.[0-9]*$
RewriteRule ^ - [F]
<Location />