# Client SSL Authentication

**URL:** <https://community.f5.com/t/client-ssl-authentication/45596>\
**Category:** Technical Forums\
**Tags:** design, config\
**Created:** [February 14, 2013, 5:04pm UTC](https://community.f5.com/t/client-ssl-authentication/45596 "2013-02-14T17:04:31Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Frankenfie](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@Eric\_Frankenfie](https://community.f5.com/u/Eric_Frankenfie)\
**Post date:** [February 14, 2013, 5:04pm UTC](https://community.f5.com/t/client-ssl-authentication/45596/1 "2013-02-14T17:04:31Z")

</div>

I have a virtual server using a client SSL profile to offload SSL processing, but I would like to take this a step further and require SSL client authentication to prevent man in the middle attacks. Each customer would be required to have their own SSL certificate to authenticate the requests and all requests without a client authentication certificate would be dropped.

Virtual\_Server\_A --\> SSL\_Client\_Profile\_A --\> Pool\_A

Customer\_A would have a certificate SSL\_Auth\_A

Customer\_B would have a certificate SSL\_Auth\_B

Customer\_C would have a certificate SSL\_Auth\_C

I am currently running version 10.2

How would I accomplish this?

---

<div class="post-metadata">

**Author:** ![What\_Lies\_Bene1](https://avatars.discourse-cdn.com/v4/letter/w/59ef9b/32.png) [@What\_Lies\_Bene1](https://community.f5.com/u/What_Lies_Bene1)\
**Post date:** [February 14, 2013, 6:02pm UTC](https://community.f5.com/t/client-ssl-authentication/45596/2 "2013-02-14T18:02:23Z")

</div>

As long as all the certificates are signed by the same CA (and you have the CA certificate) you should be OK;

1) Install the relevant CA certificate on the device

2) Configure a ClientSSL certificate with setting Client Certificate: require

3) Select the certificate in Trusted Certificate Authorities

4) Apply to the VS

5) Test a lot!

---

<div class="post-metadata">

**Author:** ![Kevin\_Stewart](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/kevin_stewart/32/15267_2.png) [@Kevin\_Stewart](https://community.f5.com/u/Kevin_Stewart)\
**Post date:** [February 14, 2013, 6:32pm UTC](https://community.f5.com/t/client-ssl-authentication/45596/3 "2013-02-14T18:32:24Z")

</div>

Client certificate authentication can be broken into two primary categories: revocation and validation.

Revocation is the process of determining if a certificate has been revoked by its issuer and involves processes like OCSP, CRLDP, and direct CRL lookup.OCSP and CRLDP are available in the Access Policy Manager module, and direct CRL lookup is available in the client SSL profile. Revocation is not explicitly required for client certificate authentication.

Validation on the other hand is the process of checking the client certificate for correct attributes. At the very least it’s concerned with a) validity dates - that the certificate is not being used before or after a certain range of dates, and b) trust. Based on the notion that PKI (public key infrastructure) is a “three-party” system where two of the parties who trust a common authority, by transition will trust each other, certificate trust establishment is the cryptographic mechanism that an entity will use to establish a trusting “link” to that common authority. So for example, imagine a server ([www.example.com](http://www.example.com)) is issued a certificate by a subordinate certificate authority ([ca-sub1.example.com](http://ca-sub1.example.com)), which was issued its certificate by the root certificate authority ([ca.example.com](http://ca.example.com)).

[www.example.com](http://www.example.com) ↔ [ca-sub1.exmaple.com](http://ca-sub1.exmaple.com) ↔ [ca.example.com](http://ca.example.com)

In this example you’ve established a chain of trust from the server certificate all the way to the (self-signed) root certificate by way of cryptographic signatures in each parent-child relationship. Now suppose a client is issued a certificate from another subordinate authority ([ca-sub2.example.com](http://ca-sub2.example.com)) which was also issued its certificate from the same root CA ([ca.example.com](http://ca.example.com)). When the client presents its certificate to the server, the server must build a chain from the client’s certificate to the common root in order to establish “trust”. On the BIG-IP, this is done using a bundle file that is assigned to the Trusted Certificate Authorities option in the client SSL profile. A bundle is a simple text file that contains the base64 PEM-encoded certificates of ALL of the possible client certificate issuers up to and including the self-signed root. The bundle would look something like this:

-----BEGIN CERTIFICATE-----

MIIDejCCAmKgAwIBAgIBBTANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJVUzEY

…

-----END CERTIFICATE-----

-----BEGIN CERTIFICATE-----

MIIFxzCCBK+gAwIBAgICALEwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCVVMx

…

-----END CERTIFICATE-----

…

So in the above example, the bundle should contain, at a minimum, [ca.example.com](http://ca.example.com) and [ca-sub2.example.com](http://ca-sub2.example.com). If you’ve ever looked at the certificate store in your browser, the bundle file is the client certificate equivalent of that - an explicit list of certificates to trust. So in summary, in the client SSL profile, set Client Certificate to request or require and then select your CA bundle in the Trusted Certificate Authorities drop down. One other really cool feature of the BIG-IP client SSL profile, and something that many web servers can’t do on their own is the notion of “root hints”. If you apply a bundle file to the Advertised Certificate Authorities drop down, when the BIG-IP, as part of the SSL negotiation, requests the client’s certificate, it will include a list (this list) of acceptable issuers. If you’re in an organization that issues different certificates for different things from different issuers, and a user may have two or more of these certificates, this is a great way to selectively eliminate certificates from the list that the browser presents.

---

<div class="post-metadata">

**Author:** ![Eric\_Frankenfie](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@Eric\_Frankenfie](https://community.f5.com/u/Eric_Frankenfie)\
**Post date:** [February 14, 2013, 7:54pm UTC](https://community.f5.com/t/client-ssl-authentication/45596/4 "2013-02-14T19:54:32Z")

</div>

Is it possible to authenticate to a specific certificate such as [clientA.example.com](http://clientA.example.com) and [clientB.example.com](http://clientB.example.com) or will anything signed by \*.example.com be sucessfully authenticated. Maybe an iRule…

if client certificate is in client\_auth\_dataGroup

then permit

else

discard

---

<div class="post-metadata">

**Author:** ![Kevin\_Stewart](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/kevin_stewart/32/15267_2.png) [@Kevin\_Stewart](https://community.f5.com/u/Kevin_Stewart)\
**Post date:** [February 14, 2013, 8:18pm UTC](https://community.f5.com/t/client-ssl-authentication/45596/5 "2013-02-14T20:18:39Z")

</div>

Validation and authentication are still two different things. You’ve successfully validated a certificate by way of checking (at a minimum) validity dates and trust. To authenticate, or rather “assert” the identity of a user via their certificate, there are a number of ways to approach this. The easiest is probably with X509. Inside a certificate is a bundle of (text) data called X509 (or at least information arranged by the X509 standard). At a minimum there are values for subject, issuer, validity dates, and serial number. But there can also be Subject Alternative Names (email addresses, UPNs, etc.), certificate policies (what kind of cert it is - software certificate, smartcard, etc.), key usage, OCSP/CRLDP revocation URLs, and many more. These X509 values are all accessible via iRules using the X509:: commands ([https://devcentral.f5.com/wiki/iRules.X509.ashx](https://devcentral.f5.com/wiki/iRules.X509.ashx)). So to get the certificate subject:

[X509::subject [SSL::cert 0]]

You can then very easily create a data group of acceptable certificate subjects and use a quick iRule in the CLIENTSSL\_CLIENTCERT event to allow or block specific users/certs:

```tcl
when CLIENTSSL_CLIENTCERT {
   if { [SSL::cert count] > 0 } {
      if { not { [class match [X509::subject [SSL::cert 0]] equals cert_data_group] ) } {
          client certificate (subject) not in the data group - log and drop
         log local0. "User presented a certificate ([X509::subject [SSL::cert 0]]) that is not in the data group - rejecting"
         reject
      }
}

```

The above is a whitelist example. You can also use other values in the certificate, as mentioned earlier.

---

<div class="post-metadata">

**Author:** ![Steve\_Hong\_8454](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@Steve\_Hong\_8454](https://community.f5.com/u/Steve_Hong_8454)\
**Post date:** [October 9, 2013, 10:59pm UTC](https://community.f5.com/t/client-ssl-authentication/45596/6 "2013-10-09T22:59:36Z")

</div>

hi, Is there a way using iRULE to create a “whitelist” based on source IP to disable the client cert authentication? if so, can someone share their iRULE?

thanks.

---

<div class="post-metadata">

**Author:** ![Kevin\_Stewart](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/kevin_stewart/32/15267_2.png) [@Kevin\_Stewart](https://community.f5.com/u/Kevin_Stewart)\
**Post date:** [October 10, 2013, 1:55am UTC](https://community.f5.com/t/client-ssl-authentication/45596/7 "2013-10-10T01:55:05Z")

</div>

The easiest thing would probably be to create two client SSL profiles: one with client authentication and one without, then create an address-based data group that contains your whitelist IPs/IP subnets. Here’s what the iRule might look like:

```tcl
when CLIENT_ACCEPTED {
    if { [class match [IP::client_addr] equals my_ip_dg] } {
        SSL:profile noauth_clientssl
    } else {
        SSL::profile auth_clientssl
    }
}

```

where “my\_ip\_dg” is the name of the arbitrarily-named address-based data group, and “noauth\_clientssl” and “auth\_clientssl” are the names of the client SSL profiles - no auth and auth respectively.

---

<div class="post-metadata">

**Author:** ![Neeraj\_Jags\_152](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@Neeraj\_Jags\_152](https://community.f5.com/u/Neeraj_Jags_152)\
**Post date:** [May 28, 2014, 10:09am UTC](https://community.f5.com/t/client-ssl-authentication/45596/8 "2014-05-28T10:09:15Z")

</div>

Hi, my setup is like below.

Client\_A , Client\_B, Client\_C client A & B are using self signed certificates so are different different certificates and Client using standard CA signed Certificate and which will have chain of certificates.

so all three certificate are different.

I have configured one virtual server (via iAPP) for SSL port 8002 to balance the traffic for all three client A,B,C.

back end servers (pool members) are also re-encrypting.

Now my queries is how to make single CA bundle for all three Certificates. and how client authentication done from single file for example if client B comes and how if client C comes which have chain of certificate.

Appreciate help.

Regards, Neeraj Jagetia

---

<div class="post-metadata">

**Author:** ![nitass](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/nitass/32/2270_2.png) [@nitass](https://community.f5.com/u/nitass)\
**Post date:** [May 28, 2014, 10:23am UTC](https://community.f5.com/t/client-ssl-authentication/45596/9 "2014-05-28T10:23:44Z")

</div>

Now my queries is how to make single CA bundle for all three Certificates.

have you tried to combine (concatenation) all ca and chain certificates to one file and set it as trusted certificate authorities?

---

<div class="post-metadata">

**Author:** ![Chris\_18457](https://avatars.discourse-cdn.com/v4/letter/c/ebca7d/32.png) [@Chris\_18457](https://community.f5.com/u/Chris_18457)\
**Post date:** [June 11, 2014, 8:46pm UTC](https://community.f5.com/t/client-ssl-authentication/45596/10 "2014-06-11T20:46:35Z")

</div>

The link below will walk you through the steps to create a custom cabundle for the roots you want to trust.

> **[404 Page not found | BIG-IP Documentation](https://techdocs.f5.com/kb/en-us/solutions/public/13000/300/sol13302.html)**
>
> Usage information and technical documentation for BIG-IP and other related F5 products

---

<div class="post-metadata">

**Author:** ![Neeraj\_Jags\_152](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@Neeraj\_Jags\_152](https://community.f5.com/u/Neeraj_Jags_152)\
**Post date:** [November 13, 2014, 1:10pm UTC](https://community.f5.com/t/client-ssl-authentication/45596/11 "2014-11-13T13:10:52Z")

</div>

Hi Kevin / Nitas / Chris,

I got certificate from Client (Bank) which is self signed by openssl from Client LAPTOP. then how can have find root CA to select or how can I find CA as it was self signed.

when I enable ’ Client Certificate’ \> to ignore it works but when I enable ’ Client Certificate’ to require, it does not work

my Worry is what to select in field ’ Trusted Certificate Authorities’ \> bank provided certificate or F5 default available ‘ca-bundle’ or ‘default’ or ‘f5-irule’ ?

Regards, Neeraj Jagetia

---

<div class="post-metadata">

**Author:** ![nitass](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/nitass/32/2270_2.png) [@nitass](https://community.f5.com/u/nitass)\
**Post date:** [November 16, 2014, 4:44am UTC](https://community.f5.com/t/client-ssl-authentication/45596/12 "2014-11-16T04:44:11Z")

</div>

I got certificate from Client (Bank) which is self signed by openssl from Client LAPTOP. then how can have find root CA to select or how can I find CA as it was self signed.

isn’t ca client certificate itself (because it is self-signed)?

```tcl
[root@centos1 ~] openssl x509 -in client_a.crt -noout -subject -issuer
subject= /C=GB/ST=Berkshire/L=Newbury/O=My Company Ltd
issuer= /C=GB/ST=Berkshire/L=Newbury/O=My Company Ltd

```

when I enable ’ Client Certificate’ \> to ignore it works but when I enable ’ Client Certificate’ to require, it does not work

e.g.

```tcl
configuration

root@ve10(Active)(tmos) list ltm virtual bar
ltm virtual bar {
    destination 172.28.24.9:https
    ip-protocol tcp
    mask 255.255.255.255
    pool foo
    profiles {
        myclientssl {
            context clientside
        }
        serverssl {
            context serverside
        }
        tcp { }
    }
    snat automap
}
root@ve10(Active)(tmos) list ltm profile client-ssl myclientssl
ltm profile client-ssl myclientssl {
    ca-file client_a.crt
    defaults-from clientssl
    peer-cert-mode require
}

 self-signed certificate

[root@ve10:Active] config openssl x509 -in /config/ssl/ssl.crt/client_a.crt -noout -subject -issuer
subject= /C=GB/ST=Berkshire/L=Newbury/O=My Company Ltd
issuer= /C=GB/ST=Berkshire/L=Newbury/O=My Company Ltd

 test

[root@centos1 ~] curl -Ik https://172.28.24.9/ --cert client_a.crt --key client_a.key
HTTP/1.1 200 OK
Date: Sun, 16 Nov 2014 05:28:56 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Sun, 09 Feb 2014 08:39:51 GMT
ETag: "41879c-59-2a9c23c0"
Accept-Ranges: bytes
Content-Length: 89
Content-Type: text/html; charset=UTF-8

```
