Standard preamble:
========================================================================
..
.... Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.
If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.
Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================
Title "SSL_CTX_LOAD_VERIFY_LOCATIONS 3ossl"
way too many mistakes in technical documents.
Details of the certificate verification and chain checking process are described in \*(L"Certification Path Validation\*(R" in openssl-verification-options\|(1).
\fBSSL_CTX_set_default_verify_paths() specifies that the default locations from which \s-1CA\s0 certificates are loaded should be used. There is one default directory, one default file and one default store. The default \s-1CA\s0 certificates directory is called certs in the default OpenSSL directory, and this is also the default store. Alternatively the \s-1SSL_CERT_DIR\s0 environment variable can be defined to override this location. The default \s-1CA\s0 certificates file is called cert.pem in the default OpenSSL directory. Alternatively the \s-1SSL_CERT_FILE\s0 environment variable can be defined to override this location.
\fBSSL_CTX_set_default_verify_dir() is similar to \fBSSL_CTX_set_default_verify_paths() except that just the default directory is used.
\fBSSL_CTX_set_default_verify_file() is similar to \fBSSL_CTX_set_default_verify_paths() except that just the default file is used.
\fBSSL_CTX_set_default_verify_store() is similar to \fBSSL_CTX_set_default_verify_paths() except that just the default store is used.
.Vb 3 -----BEGIN CERTIFICATE----- ... (CA certificate in base64 encoding) ... -----END CERTIFICATE----- .Ve
sequences. Before, between, and after the certificates text is allowed which can be used e.g. for descriptions of the certificates.
The CAfile is processed on execution of the SSL_CTX_load_verify_locations() function.
If CApath is not \s-1NULL,\s0 it points to a directory containing \s-1CA\s0 certificates in \s-1PEM\s0 format. The files each contain one \s-1CA\s0 certificate. The files are looked up by the \s-1CA\s0 subject name hash value, which must hence be available. If more than one \s-1CA\s0 certificate with the same name hash value exist, the extension must be different (e.g. 9d66eef0.0, 9d66eef0.1 etc). The search is performed in the ordering of the extension number, regardless of other properties of the certificates. Use the c_rehash utility to create the necessary links.
The certificates in CApath are only looked up when required, e.g. when building the certificate chain or when actually performing the verification of a peer certificate.
When looking up \s-1CA\s0 certificates for chain building, the OpenSSL library will search for suitable certificates first in CAfile, then in CApath. Details of the chain building process are described in \*(L"Certification Path Building\*(R" in openssl-verification-options\|(1).
If CAstore is not \s-1NULL,\s0 it's a \s-1URI\s0 for to a store, which may represent a single container or a whole catalogue of containers. Apart from the CAstore not necessarily being a local file or directory, it's generally treated the same way as a CApath.
In server mode, when requesting a client certificate, the server must send the list of CAs of which it will accept client certificates. This list is not influenced by the contents of CAfile or CApath and must explicitly be set using the \fBSSL_CTX_set_client_CA_list\|(3) family of functions.
When building its own certificate chain, an OpenSSL client/server will try to fill in missing certificates from CAfile/CApath, if the certificate chain was not explicitly specified (see \fBSSL_CTX_add_extra_chain_cert\|(3), \fBSSL_CTX_use_certificate\|(3).
\fBSSL_CTX_set_default_verify_paths(), SSL_CTX_set_default_verify_dir() and \fBSSL_CTX_set_default_verify_file() all return 1 on success or 0 on failure. A missing default location is still treated as a success.
.Vb 5 #!/bin/sh rm CAfile.pem for i in ca1.pem ca2.pem ca3.pem ; do openssl x509 -in $i -text >> CAfile.pem done .Ve
Prepare the directory /some/where/certs containing several \s-1CA\s0 certificates for use as CApath:
.Vb 2 cd /some/where/certs c_rehash . .Ve
Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use this file except in compliance with the License. You can obtain a copy in the file \s-1LICENSE\s0 in the source distribution or at <https://www.openssl.org/source/license.html>.