SSL_CTX_set_default_verify_file (3)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
SSL_CTX_load_verify_locations, SSL_CTX_set_default_verify_paths, SSL_CTX_set_default_verify_dir, SSL_CTX_set_default_verify_file - set default locations for trusted CA certificatesSYNOPSIS
#include <openssl/ssl.h> int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, const char *CApath); int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx); int SSL_CTX_set_default_verify_dir(SSL_CTX *ctx); int SSL_CTX_set_default_verify_file(SSL_CTX *ctx);
DESCRIPTION
SSL_CTX_load_verify_locations() specifies the locations for ctx, at whichSSL_CTX_set_default_verify_paths() specifies that the default locations from which
SSL_CTX_set_default_verify_dir() is similar to SSL_CTX_set_default_verify_paths() except that just the default directory is used.
SSL_CTX_set_default_verify_file() is similar to SSL_CTX_set_default_verify_paths() except that just the default file is used.
NOTES
If CAfile is not
-----BEGIN CERTIFICATE----- ... (CA certificate in base64 encoding) ... -----END CERTIFICATE-----
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
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
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 SSL_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 SSL_CTX_add_extra_chain_cert(3), SSL_CTX_use_certificate(3).
WARNINGS
If severalEXAMPLES
Generate a
#!/bin/sh rm CAfile.pem for i in ca1.pem ca2.pem ca3.pem ; do openssl x509 -in $i -text >> CAfile.pem done
Prepare the directory /some/where/certs containing several
cd /some/where/certs c_rehash .
RETURN VALUES
For SSL_CTX_load_verify_locations the following return values can occur:- 0
-
The operation failed because CAfile and CApath are NULLor the processing at one of the locations specified failed. Check the error stack to find out the reason.
- 1
- The operation succeeded.
SSL_CTX_set_default_verify_paths(), SSL_CTX_set_default_verify_dir() and SSL_CTX_set_default_verify_file() all return 1 on success or 0 on failure. A missing default location is still treated as a success.
SEE ALSO
ssl(3), SSL_CTX_set_client_CA_list(3), SSL_get_client_CA_list(3), SSL_CTX_use_certificate(3), SSL_CTX_add_extra_chain_cert(3), SSL_CTX_set_cert_store(3), SSL_CTX_set_client_CA_list(3)COPYRIGHT
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.Licensed under the OpenSSL license (the ``License''). You may not use this file except in compliance with the License. You can obtain a copy in the file