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 5dadfbc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions components/core/src/package/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,22 @@ impl PackageInstall {
env.insert(key, rooted_path);
}

// Since some of the packages that depend upon OpenSSL set this environment in the
// `RUNTIME_ENVIRONMENT` value by default. 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` (pointint 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 let Some(_) = ssl_cert_file_from_env {
true
} else {
false
};

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

Ok(env)
}

Expand Down

0 comments on commit 5dadfbc

Please sign in to comment.