Skip to content

Commit 142ee96

Browse files
authored
Initialize openssl-probe env vars if curl requires init (#418)
This commit should fix an issue that showed up in rust-lang/cargo#10013 where curl's initialization was accidentally detecting that curl needed an early initialization (due to sfackler/rust-openssl#1548). This early initialization caused the later env-vars set by `openssl-probe` to not actually be read since OpenSSL was already initialized. While not an issue for `curl` I think it does pose an issue for other libraries like libgit2 using OpenSSL. The fix here is to initialize the env vars before OpenSSL, which should have OpenSSL pick up the probe results.
1 parent df64ee4 commit 142ee96

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ pub fn init() {
107107
)]
108108
extern "C" fn init_inner() {
109109
INIT.call_once(|| {
110+
#[cfg(need_openssl_init)]
111+
openssl_probe::init_ssl_cert_env_vars();
110112
#[cfg(need_openssl_init)]
111113
openssl_sys::init();
112114

0 commit comments

Comments
 (0)