Skip to content

Instantly share code, notes, and snippets.

@pedroagabreu
Created May 5, 2014 17:30
Show Gist options
  • Save pedroagabreu/fbcf8ed5eb03cf533c1f to your computer and use it in GitHub Desktop.
Save pedroagabreu/fbcf8ed5eb03cf533c1f to your computer and use it in GitHub Desktop.
Client certificate verification in Apache.
# verify client certificates using CA.pem
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/ServerCertAndKey.pem
SSLCACertificateFile /etc/apache2/ssl/CA.pem
SSLVerifyClient require
SSLVerifyDepth 1
# allow connections from certain CN only, except for that guy
SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)-/ and %{SSL_CLIENT_S_DN_CN} =~ m/^ROBOTS/ and %{SSL_CLIENT_S_DN_CN} !~ m/^ROBOTS - Bad Robot/ )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment