# Client certificate authentication

**URL:** <https://community.letsencrypt.org/t/client-certificate-authentication/6552>\
**Category:** Uncategorized\
**Created:** [December 10, 2015, 6:47am UTC](https://community.letsencrypt.org/t/client-certificate-authentication/6552 "2015-12-10T06:47:36Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimaj](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/dimaj/32/2805_2.png) [@dimaj](https://community.letsencrypt.org/u/dimaj)\
**Post date:** [December 10, 2015, 6:47am UTC](https://community.letsencrypt.org/t/client-certificate-authentication/6552/1 "2015-12-10T06:47:36Z")

</div>

Hello,

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…

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!

---

<div class="post-metadata">

**Author:** ![motoko](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/motoko/32/26328_2.png) [@motoko](https://community.letsencrypt.org/u/motoko)\
**Post date:** [December 10, 2015, 7:11am UTC](https://community.letsencrypt.org/t/client-certificate-authentication/6552/2 "2015-12-10T07:11:12Z")

</div>

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

> [@dimaj](#):
>
> What do I specify for the SSLCACertificateFile

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.

> [@dimaj](#):
>
> How do get a client certificate and how do I sign it?

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](https://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslverifyclient) along with [SSLRequire](https://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslrequire) or the newer replacement [Require expr](https://httpd.apache.org/docs/2.4/mod/mod_authz_core.html#reqexpr).

---

<div class="post-metadata">

**Author:** ![Osiris](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@Osiris](https://community.letsencrypt.org/u/Osiris)\
**Post date:** [December 10, 2015, 7:15am UTC](https://community.letsencrypt.org/t/client-certificate-authentication/6552/3 "2015-12-10T07:15:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/riking/32/92126_2.png) [@riking](https://community.letsencrypt.org/u/riking)\
**Post date:** [December 10, 2015, 8:17am UTC](https://community.letsencrypt.org/t/client-certificate-authentication/6552/4 "2015-12-10T08:17:20Z")

</div>

> [@Osiris](#):
>
> 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.

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

---

<div class="post-metadata">

**Author:** ![dimaj](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/dimaj/32/2805_2.png) [@dimaj](https://community.letsencrypt.org/u/dimaj)\
**Post date:** [December 10, 2015, 4:34pm UTC](https://community.letsencrypt.org/t/client-certificate-authentication/6552/5 "2015-12-10T16:34:53Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![michelde](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@michelde](https://community.letsencrypt.org/u/michelde)\
**Post date:** [January 7, 2017, 10:06am UTC](https://community.letsencrypt.org/t/client-certificate-authentication/6552/6 "2017-01-07T10:06:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dimaj](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/dimaj/32/2805_2.png) [@dimaj](https://community.letsencrypt.org/u/dimaj)\
**Post date:** [January 8, 2017, 8:23am UTC](https://community.letsencrypt.org/t/client-certificate-authentication/6552/7 "2017-01-08T08:23:37Z")

</div>

Hello Michelde,

Here’s my config:

\<VirtualHost \*:443\>  
Some other directives go here

```
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 />

```

I hope this helps!

Regards,

dimaj [http://blog.dimaj.net](http://blog.dimaj.net)

---

<div class="post-metadata">

**Author:** ![schoen](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/schoen/32/79_2.png) [@schoen](https://community.letsencrypt.org/u/schoen)\
**Post date:** [January 9, 2017, 1:07am UTC](https://community.letsencrypt.org/t/client-certificate-authentication/6552/8 "2017-01-09T01:07:42Z")

</div>

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

[https://mozilla.github.io/server-side-tls/ssl-config-generator/](https://mozilla.github.io/server-side-tls/ssl-config-generator/)

to update the cryptographic parameters there.

---

<div class="post-metadata">

**Author:** ![dimaj](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/dimaj/32/2805_2.png) [@dimaj](https://community.letsencrypt.org/u/dimaj)\
**Post date:** [January 9, 2017, 1:20am UTC](https://community.letsencrypt.org/t/client-certificate-authentication/6552/9 "2017-01-09T01:20:54Z")

</div>

That looks interesting. Thanks!

---

<div class="post-metadata">

**Author:** ![jgdvivek](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/jgdvivek/32/28042_2.png) [@jgdvivek](https://community.letsencrypt.org/u/jgdvivek)\
**Post date:** [December 9, 2018, 10:13am UTC](https://community.letsencrypt.org/t/client-certificate-authentication/6552/10 "2018-12-09T10:13:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dimaj](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/dimaj/32/2805_2.png) [@dimaj](https://community.letsencrypt.org/u/dimaj)\
**Post date:** [December 9, 2018, 3:20pm UTC](https://community.letsencrypt.org/t/client-certificate-authentication/6552/11 "2018-12-09T15:20:04Z")

</div>

Correct, the SSLCACertificateFile is your CA that is used to sign client certificates.  
I found this guide very helpful: [https://jamielinux.com/docs/openssl-certificate-authority/introduction.html](https://jamielinux.com/docs/openssl-certificate-authority/introduction.html)

---

<div class="post-metadata">

**Author:** ![jsha](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/jsha/32/12_2.png) [@jsha](https://community.letsencrypt.org/u/jsha)\
**Post date:** [December 9, 2018, 5:48pm UTC](https://community.letsencrypt.org/t/client-certificate-authentication/6552/12 "2018-12-09T17:48:38Z")

</div>

Closed on December 9, 2018, 5:48pm UTC


