Technology Knowledge Base - Client Certificate FAQ

Overview

Most email and instant messages are unencrypted and thus are sort of like postcards. This means that people with access to the network can read them. That often includes those with access to wireless networks you use, personnel at your ISP, those who run the services you use, governmental authorities and others.

Your CAcert client certificates can make your use of the Internet more secure by allowing you to create emails and instant messages that are encrypted end-to-end, and by letting you log into web pages in ways that can be more secure than using a password. You can also sign messages and electronic documents.

CAcert

Within CAcert the following systems are now client-cert enabled:

URL to click

Name of system

type of usage

comments

software

https://secure.cacert.org/

the main online system for CAcert users

CC or passwords

can do client-cert login. Click on Certificate Login instead of "Normal Login"

CAcert

https://blog.cacert.org/

CAcert's Blog

CC for writing, read is open

uses client-certs to let you add comments, write posts and so forth. Click on Log in. This makes it spam-free :-)

wordpress

https://cats.cacert.org/

CATS - CAcert Automated Testing Service

CC only

Runs our famous AssurerChallenge. When you have passed the challenge, CATS notifies CAcert of your certificate serial number and this account is updated with your PASS mark.

CATS by CAcert

https://lists.cacert.org/wws/

Maillists

CC only ?

To adjust your subscriptions to email lists

Sympa

https://community.cacert.org/board/motions.php

Voting system

CC for voting, read is open

The board uses this system to record board motions and voting.

custom

All of the above systems are run by CAcert directly. Add Assurer-run systems below:

URL to click

Name of system

type of usage

comments

software

To get your client-cert from CAcert

Before the above sites will work, you need to create a client certificate and import it into your web browser.

  1. Log in to the CAcert website and choose "Client Certificate -> New".

  2. Select your default email address and click "Next".
  3. 2048 bit won't hurt, just click "Create Certificate Request".
  4. Wait some time and click on the link to import the certificate (note browsers handle this differently, so click around).
  5. Try it out by going to one of the above sites.

Applications

You can use your Client Certificate in many applications for a lot of purposes. Here are some examples.

Email Clients

Personal EmailCertificates - How to configure and to how to use them.

Web Browser

You can login to any web site that uses OpenID for authentication using your CAcert client ssl certificate and any OpenID software or service that supports SSL Certificates, such as certifi.ca. See OpenID for more on CAcert's evolving approach there.

You can also use a client certificate in your web browser to get directly authenticated directly on some websites. The CATS AssurerChallenge is one such, and this site requires you to have a CAcert client certificate. See above for more sites.

Gotchas

Using client certificates for login is more secure than using passwords in technical terms, but there are some gotchas:

For all these reasons you should keep your CAcert password written down in a safe place.

Instant Messaging (IMs)

Most of the common Instant Messaging Clients for Jabber, MSN, AIM, ICQ, etc. don't encrypt your messages by default. But you can sometimes encrypt your instant messages.

Examples

Note: there were reports that AOL asserted the right to use your AIM messages for any purpose, but they say that was a misinterpretation: http://www.snopes.com/computer/internet/aim.asp

OpenSSH

Using your CAcert client certificate to login via SSH (on Linux):

Encryption Applications

<!> Note: CAcert does not provide support for the following products; we only issue the certs!

Signing Documents

OpenOffice up from version 2.0 is able to sign documents. Please read the wiki for OpenOffice.

Modifying software to use client certificates

Essentially, it isn't easy to use client-certs unless the software at the server side actually takes them and uses them. This means that we need to get a lot of these servers up and running, and document the methods so others can follow. This section is an index into known experiences here. You can help: set your system up to use client-certs, and document how it went!

OpenID

If your web application or web site supports OpenID, people can choose to use an OpenID server that supports the use of their CAcert client certificates when using your web application or web site. See OpenID for providers and info.

Apache

See

phpBB (ver 3) discussion forum

You can let your discussion forum users to log in using certificates. Addition to the original code is simple (please ask the phpBB community to make this a default feature) Add following code to your authority plugin (by default includes/auth/auth_db.php)

function autologin_db()
{
        global $db, $config;
        if ($_SERVER[SSL_CLIENT_VERIFY] == "SUCCESS")
        {
                $sql = "SELECT * FROM " . USERS_TABLE . "
                  WHERE user_email = '" . $db->sql_escape($_SERVER[SSL_CLIENT_S_DN_Email]) . "'";
                $result = $db->sql_query($sql);
                $row = $db->sql_fetchrow($result);
                $db->sql_freeresult($result);
                if ($row)
                {
                        return $row;
                }
        }
        return array();
}


Enable Client Certs for .project


FAQ and Misc - Client Cert Troubleshooting

My IE is showing error code number "-2146885628" (or similar)

Nearly all error messages related to certificate installs are the result of people not having a matching private key, or for the cert logins, not being able to match a key/certificate valid for the CAs acceptable.

Basically people have reinstalled things on their computer, or are using a different browser and don't realize that we don't keep copies of private keys they can then later download along with the certificate from our website.

"Where is my private key? How do I use it on another computer?"

Your private key is generated by your browser, *IN* your browser when you request a new cert from CAcert. That way CAcert never has your private key in its possession. The implication for you is that you must be on the same machine using the same browser that you used to request the cert initially, when needing to access your private key. So don't forget if it was your "work" machine vs. your "home" machine.

Your keys are contained in something called the key "store". You may export public/private keypairs from your store to a file, and optionally (but highly recommended!) secure them with a passphrase. This is typically done by going into the "Manage Certificates" section of your browser (i.e., Firefox), and then performing a "Backup" of your key. This will create a file with with a .P12 or .PFX suffix.

You may then go into another application which uses client certificates (e.g., Thunderbird, IM, etc.,), and use "Manage Certificates" to "Import" the .P12 file previously created. After providing the correct passphrase, your public/private keypairs will now be available in the new application.

/!\ it is very interesting to generate a keypair and your CAcert cert on a smartcard. That's wise and a good way to protect your keys. But don't forget, you'll never be able to export the private key ;-) see CryptoHardware

Were is the PKCS12 file? - I only have the PEM file that says its for smartcard only

openssl pkcs12 -export -in cert.pem -inkey  private.key -certfile /etc/ssl/certs/root.pem -name "Bob's CAcert" -out cert.p12

"Windows does not have enough information to verify this certificate"

[Q] I am using win2000 and outlook from office 2000. I installed my certificate using IE and went to outlook - options - security - settings to choose the cert that I installed. The trouble I'm having is that when I try to send a signed and encrypted E-mail, I get an error that the cert is not valid. When viewing the cert in outlook, it states that "windows does not have enough information to verify this certificate"

[A] It sounds like you might be missing the CAcert Root certificate and/or you have it, but have not "trusted" it yet. You can pick up a copy at: https://www.cacert.org/index.php?id=3

Once it is installed, check to see if it is trusted. That will hopefully solve the error you're getting with your personal cert.

[A] Each email address that you are sending too in outlook needs to have a public certificate assoicated with it. To get that certificate for the person you are trying to send an encrypted message to have them send a signed email to you.

When you recieve that email right click on the senders address (not the email itself). Select add to contacts. This will install the public certificate for you to use when sending emails. You can see that certificate by selecting the certificates tab on the top of your contact information.

If this person is already in your contact list then do the following:

Right click the senders address (not the email itself). Select add to contacts. Select the certificates tab. highlight the certificate and select export. Change the name to something you will recognize and select a location you will remember, enter a password and save. Close the new contact and do not save the changes (this removes the duplicate contact). Right click the senders address (by now you should recoginize the pattern) select lookup contact. select the certificates tab and import the certificate using the path, name and password you just entered. You should be able to send encrypted messages to that address now.

My cert is in the browser but not my email client - what now?

[Q] I tried to install my e-mail cert into Mozilla Thunderbird (the latest as of today) and somehow could not sign a message. Thunderbird tells me that I first have to set up my certificates (hey - I did that! and I verified that the cert is there, including the CA root) and if I want to learn how to do that - sure I say yes - the dialog goes away and nothing happens.

[A] You need to export the certificate and private key from your browser; just importing the certificate is only half the information needed to encrypt/sign emails. CAcert never gets (or even wants) a copy of your private key. (See topic 3.1 for more details)

How to enable Client Cert authentication in your Web-Applications

<!> There is also a PHP example on the CAcert.org website including details on Apache configuration.

Unfortunately client authentication does not seem to work when SSLCACertificatePath option in Apache2 is used. This seems to be default configuration for example in Ubuntu. To fix it:

change

to

in your apache configuration files and it works again..

If you need a CA-Bundle for your webserver, you can get one, which has CAcert included here: http://www2.futureware.at/svn/sourcerer/CAcert/ca-bundle.zip

Unanswered question: How do I simply add CAcert to my existing ca-bundle? Answer: Get the CAcert root certificates (both Class1 and Class3), open them in a Text-Editor, and copy&paste them into the ca-bundle, for example at the end of the file.

For the following example, you have to set SSLVerify to "optional" or "required" in your Apache configuration. "required" forces the browser to show a certificate, and does not give access to the Vhost (or directory), unless the client presents a valid certificate. "optional" accepts certificates optionally, so the client can also access the vhost without a certificate. When you set SSLOptions to +CompatEnvVars +StdEnvVars then mod_ssl will put all interesting details into the environment variables, which are easily accessible from any programming language:

$ca="";
if($ENV{'SSL_CLIENT_VERIFY'} and $ENV{'SSL_CLIENT_VERIFY'} eq "SUCCESS")
{
  if($ENV{SSL_CLIENT_I_DN_OU} eq "http://www.cacert.org")
  {
    $ca="CAcert";
  }
  if($ca and $ENV{SSL_CLIENT_S_DN_Email})
  {
    $auth="email+clientzert";
    $authuser=$ENV{SSL_CLIENT_S_DN_CN};
    $authemail=$ENV{SSL_CLIENT_S_DN_Email};
    print "Welcome $ENV{SSL_CLIENT_S_DN_CN} (<a href=\"mailto:$ENV{SSL_CLIENT_S_DN_Email}\">)!<br/>";
  }

How can I use Client Certificates like SSH?

For your Apache configuration:

SSLOptions +ExportCertData +CompatEnvVars +StdEnvVars
SSLVerify optional_no_ca

The application:

$ca="";
if($ENV{'SSL_CLIENT_VERIFY'} and $ENV{'SSL_CLIENT_VERIFY'} eq "SUCCESS")
{
  echo $ENV{SSL_CLIENT_KEY};
}



Category or Categories

CategorySample