Skip to content

Commit

Permalink
Ignore SSL_CERT_FILE from runtime env if set
Browse files Browse the repository at this point in the history
If `SSL_CERT_FILE` environment is set by the user, then the default
`SSL_CERT_FILE` env set from `RUNTIME_ENVIRONMENT` should be ignored.

Signed-off-by: Abhijit Gadgil <[email protected]>
  • Loading branch information
agadgil-progress committed Oct 28, 2024
1 parent 5ab1734 commit 2bb89a8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions components/core/src/package/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,21 @@ impl PackageInstall {
env.insert(key, rooted_path);
}

// Since some of the packages that depend upon OpenSSL set this environment in the
// `RUNTIME_ENVIRONMENT`. We need to work around that in case the user really *wants* to
// set `SSL_CERT_FILE` to custom value (eg. in corporate firewall environments). Then our
// *default* set `SSL_CERT_FILE` (pointing to `core/cacerts`) package should be ignored.
let ssl_cert_file_from_env = std::env::var("SSL_CERT_FILE").ok();
let ssl_cert_file_process_env_set = if ssl_cert_file_from_env.is_some() {
true
} else {
false
};

if ssl_cert_file_process_env_set {
env.remove("SSL_CERT_FILE");
}

Ok(env)
}

Expand Down

0 comments on commit 2bb89a8

Please sign in to comment.