Skip to main content

load_certs_from_paths

Function load_certs_from_paths 

pub fn load_certs_from_paths(
    file: Option<&Path>,
    dir: Option<&Path>,
) -> CertificateResult
Available on crate features crypto and native-certs only.
Expand description

Load certificates from the given paths.

If both are None, returns an empty CertificateResult.

If file is Some, it must be a path to an existing, accessible file from which certificates can be loaded. The PEM parser ignores parts of the file which are not considered part of a certificate; malformed certificates may be silently skipped.

If dir is defined, a directory must exist at this path. The directory is not scanned recursively and may be empty; entries that are not readable (e.g. root-only files) are skipped.