openssl_probe

Function try_init_openssl_env_vars

Source
pub unsafe fn try_init_openssl_env_vars() -> bool
Expand description

Probe for SSL certificates on the system, then configure the SSL certificate SSL_CERT_FILE and SSL_CERT_DIR environment variables in this process for OpenSSL to use.

Preconfigured values in the environment variables will not be overwritten if the paths they point to exist and are accessible.

Returns true if any certificate file or directory was found while probing. Combine this with has_ssl_cert_env_vars() to check whether previously configured environment variables are valid.

§Safety

This function is not safe because it mutates the process’s environment variables which is generally not safe. See the documentation in libstd for information about why setting environment variables is not safe.

If possible use the probe function and directly configure OpenSSL methods instead of relying on environment variables.