Version française

Using Additional CA Certificates with curl and wget

Here's some information to use additional CA certificates with the curl and wget commands.

  1. Download the certificates into a directory, e.g. ~/etc/certs.

  2. Generate the hash values with the c_rehash command and the directory as argument. For instance: c_rehash ~/etc/certs. With the official c_rehash utility from openssl, all the certificates must have the .pem extension; to support the .crt extension as well, which is commonly used, one must either use Debian's c_rehash script or replace /\.pem$/ by /\.(crt|pem)$/ in the script.

  3. Add the certificate directory to the configuration files of curl and wget. For instance, in the ~/.curlrc file:

    --capath = /home/user/etc/certs

    (note that the ~ and $HOME forms are not supported). And in the ~/.wgetrc file:

    ca_directory = ~/etc/certs

Moreover, with MacPorts under Mac OS X, in order to have the usual certificates with curl, one must install the curl port with the ssl variant, not the gnutls one.



webmaster@vinc17.org