Skip to content

Commit

Permalink
Inline trivial load_certs_from_env() function
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Jul 3, 2024
1 parent 27d38db commit e0b388a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,12 @@ use pki_types::CertificateDer;
///
/// [c_rehash]: https://www.openssl.org/docs/manmaster/man1/c_rehash.html
pub fn load_native_certs() -> Result<Vec<CertificateDer<'static>>, Error> {
if let Some(certs) = load_certs_from_env()? {
if let Some(certs) = CertPaths::from_env().load()? {
return Ok(certs);
};
platform::load_native_certs()
}

fn load_certs_from_env() -> Result<Option<Vec<CertificateDer<'static>>>, Error> {
CertPaths::from_env().load()
}

/// Certificate paths from `SSL_CERT_FILE` and/or `SSL_CERT_DIR`.
struct CertPaths {
file: Option<PathBuf>,
Expand Down

0 comments on commit e0b388a

Please sign in to comment.