6

Usually SSL certificates are installed system-wide (e.g. in /etc/ssl/certs). Is it possible to configure OpenSSL in a way that allows user to put certificates in their home directory (for example in ~/.ssl/certs)?

A use-case could be a user that needs to access services with a self-signed certificate (generated by him, thus trusted); having the self-signed CA installed system wide would be wrong because the other users shouldn't trust that CA.

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
David Costa
  • 628
  • 5
  • 21
  • 1
    Usually you would install the Root Certificate within your application as a user. E.g. in firefox you can install root certificates Edit->Properties->Advanced->Certificates. These root certificates will only be trusted by this very user. – cornelinux Dec 03 '14 at 07:28
  • Firefox doesn't use OpenSSL, it uses NSS (also part of Mozilla). Few if any *browsers* use OpenSSL; see http://security.stackexchange.com/questions/59184/which-browsers-are-using-openssl ; I assumed the question is about client *apps*. – dave_thompson_085 Dec 03 '14 at 08:22

1 Answers1

6

If you mean applications using OpenSSL library for SSL, each application can either specify the (concatenated) file and/or (hash-linked) directory to be used for trusted certs, or it can invoke OpenSSL's defaults, or it could offer the choice. In the first case, you need to (be able and) configure the app what to specify. For example, in curl use --cacert and/or --capath per http://curl.haxx.se/docs/manpage.html . In the second case, the compiled-in OpenSSL defaults, which are system and possibly build dependent, can be overridden by environment variables SSL_CERT_FILE and SSL_CERT_DIR respectively.

If you mean applications using OpenSSL library for other things (that use certs) like CMS/SMIME, OpenSSL has a less simple API; basically the application must directly build up an X509_STORE to be used for validation, although I think it can still invoke the same defaults.

If you mean the commandline program openssl the picture is a little more complicated. Some utilities (subcommands) don't use truststore (or even certs at all); those that do have options to specify one usually -CAfile and -CApath; see the man pages for s_client, verify, ocsp etc as applicable. However, the logic that is supposed to use the defaults if you don't specify the options has long been coded inconsistently; there was discussion on the support list a few months ago and I believe a fix has (finally) been agreed, but as of 1.0.1j 15 Oct 2014 it isn't released.

dave_thompson_085
  • 3,100
  • 1
  • 15
  • 14