NAME

catcert_setcafile - set path to local CA certificates file

SYNOPSIS

#include <cat/cat.h>

int catcert_setcafile(const char *path);

DESCRIPTION

This function sets the path to the local CA certificates file to path. The file should contain one or more certificates encoded in base-64. Blank lines and lines beginning with a hash character C(#) will be ignored.

These certificates will be used when validating certificates locally. If a certificate chain ends with any of the CA certificates in the file installed by catcert_setcafile(), and the certificate is otherwise correct then the certificate is accepted.

NOTES

This function is not thread-safe, and should be called only once, during process startup.

Only one CA file can be installed for each process. Multiple files can be merged by concatenation.

RETURN VALUES

The function returns 0 if successful, or a negative code on error.

SEE ALSO

cat, catcert