]> sipb.mit.edu Git - wiki.git/blob - doc/apache-client-certs.mdwn
6a5311ebfac2dde785dd2418145c5edfc7fed859
[wiki.git] / doc / apache-client-certs.mdwn
1 [[!meta title="Configuring Client-Side Certificate Authentication on Apache"]]
2
3 While it's certainly possible to configure client-side certificate authentication on Apache using the built-in SSL module alone, it's much easier if you use the Apache modules developed for the [scripts.mit.edu](http://scripts.mit.edu) project.
4
5 ## Installing the modules
6
7 If you're using Ubuntu, Evan Broder has packaged the scripts.mit.edu modules for all current Ubuntu releases in a PPA.
8
9 The [PPA homepage](https://launchpad.net/~broder/+archive/scripts-http-mods) includes instructions on how to install the PPA on your system, but if you're on Ubuntu Karmic or later, you can just run:
10
11     # add-apt-repository ppa:broder/scripts-http-mods
12
13 Once you've installed the PPA, you want to install the libapache2-mod-auth-sslcert and libapache2-mod-authz-afsgroup packages.
14
15     # aptitude install libapache2-mod-auth-sslcert libapache2-mod-authz-afsgroup
16
17 You'll also need a working AFS client and the Athena client certificate CA. Both of these can be most easily configured by [installing Debathena](http://debathena.mit.edu/install). You can install any Debathena flavor you'd like, but `debathena-standard` flavor should include everything you need.
18
19 ## Configuring Apache
20
21 In addition to the standard Apache directives needed to enable SSL, you'll need a few more before the Apache modules work as they do on scripts. Add the following directives to each vhost that will be using SSL client-side certificate authentication:
22
23     SSLCACertificateFile /etc/ssl/certs/mitCAclient.pem
24     <Location />
25         AuthSSLCertVar SSL_CLIENT_S_DN_Email
26         AuthSSLCertStripSuffix "@MIT.EDU"
27     </Location>
28
29 You also need to require certificate authentication. You can either use `SSLVerifyClient require` or `SSLVerifyClient optional`. `SSLVerifyClient require` has the downside that, if visitors don't have client-side certificates, they'll get an obscure OpenSSL error. However, Safari will not present certificates to a site with `SSLVerifyClient optional` set unless the user sets up an Identity Preference. For reference, scripts.mit.edu sets `SSLVerifyClient optional`.
30
31 You'll also need to enable the Apache modules.
32
33     # a2enmod auth_sslcert
34     # a2enmod authz_afsgroup
35
36 Once you've done that, the instructions in the [scripts.mit.edu FAQ](http://scripts.mit.edu/faq/15) on configuring certificate access through `.htaccess` files should work.