NAME
X509_STORE_load_locations
,
X509_STORE_set_default_paths
—
configure files and directories used by
a certificate store
SYNOPSIS
#include
<openssl/x509_vfy.h>
int
X509_STORE_load_locations
(X509_STORE
*store, const char *file, const
char *dirs);
int
X509_STORE_set_default_paths
(X509_STORE
*store);
DESCRIPTION
X509_STORE_load_locations
()
instructs the store to use the PEM file
file and all the PEM files in the directories
contained in the colon-separated list dirs for looking
up certificates, in addition to files and directories that are already
configured. The certificates in the directores must be in hashed form, as
documented in
X509_LOOKUP_hash_dir(3). Directories already in use are not
added again. If NULL
is passed for
file or dirs, no new file or no
new directories are added, respectively.
X509_STORE_load_locations
()
is identical to
SSL_CTX_load_verify_locations(3) except that it operates
directly on an X509_STORE object, rather than on the
store used by an SSL context. See that manual page for more information.
X509_STORE_set_default_paths
()
is similar except that it instructs the store to use
the default PEM file and directory (as documented in
FILES) in addition to what is already
configured. It ignores errors that occur while trying to load the file or to
add the directory, but it may still fail for other reasons, for example when
out of memory while trying to allocate the required
X509_LOOKUP objects.
X509_STORE_set_default_paths
()
is identical to
SSL_CTX_set_default_verify_paths(3) except that it operates
directly on an X509_STORE object, rather than on the
store used by an SSL context. See that manual page for more information.
RETURN VALUES
X509_STORE_load_locations
() returns 1 if
all files and directories specified were successfully added. It returns 0
for failure. That can happen if adding the file failed, if adding any of the
directories failed, or if both arguments were
NULL
.
X509_STORE_set_default_paths
() returns 0
for some error conditions and 1 otherwise, not just for success, but also
for various cases of failure.
FILES
- /etc/ssl/cert.pem
- default PEM file for
X509_STORE_set_default_paths
() - /etc/ssl/certs/
- default directory for
X509_STORE_set_default_paths
()
SEE ALSO
SSL_CTX_load_verify_locations(3), X509_LOOKUP_hash_dir(3), X509_STORE_new(3), X509_STORE_set1_param(3), X509_STORE_set_verify_cb(3)
HISTORY
X509_STORE_load_locations
() and
X509_STORE_set_default_paths
() first appeared in
SSLeay 0.8.0 and have been available since OpenBSD
2.4.
BUGS
By the time that adding a directory is found to have failed, the file and some other directories may already have been successfully loaded, so these functions may change the state of the store even when they fail.
X509_STORE_set_default_paths
() clears the
error queue, deleting even error information that was already present when
it was called.