X509_get_default_cert_file3ssl
Retrieve default locations for trusted ca certificates
Usage
#include <openssl/x509.h>const char *X509_get_default_cert_file(void);const char *X509_get_default_cert_dir(void);const char *X509_get_default_cert_file_env(void);const char *X509_get_default_cert_dir_env(void);
Overview
The X509_get_default_cert_file() function returns the default path to a file containing trusted CA certificates. OpenSSL will use this as the default path when it is asked to load trusted CA certificates from a file and no other path is specified. If the file exists, CA certificates are loaded from the file.
The X509_get_default_cert_dir() function returns a default delimiter-separated list of paths to a directories containing trusted CA certificates named in the hashed format. OpenSSL will use this as the default list of paths when it is asked to load trusted CA certificates from a directory and no other path is specified. If a given directory in the list exists, OpenSSL attempts to lookup CA certificates in this directory by calculating a filename based on a hash of the certificate's subject name.
X509_get_default_cert_file_env() returns an environment variable name which is recommended to specify a nondefault value to be used instead of the value returned by X509_get_default_cert_file(). The value returned by the latter function is not affected by these environment variables; you must check for this environment variable yourself, using this function to retrieve the correct environment variable name. If an environment variable is not set, the value returned by the X509_get_default_cert_file() should be used.
X509_get_default_cert_dir_env() returns the environment variable name which is recommended to specify a nondefault value to be used instead of the value returned by X509_get_default_cert_dir(). The value specified by this environment variable can also be a store URI (but see BUGS below).
Return values
These functions return pointers to constant strings with static storage duration.
Releases
2 releases since Debian 13 (Trixie); the text changed 1 time.