We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e56c789 commit afbc72cCopy full SHA for afbc72c
src/easy/handler.rs
@@ -673,7 +673,18 @@ impl<H: Handler> Easy2<H> {
673
674
#[cfg(need_openssl_probe)]
675
fn ssl_configure(&mut self) {
676
- let probe = ::openssl_probe::probe();
+ use std::sync::Once;
677
+
678
+ static mut PROBE: Option<::openssl_probe::ProbeResult> = None;
679
+ static INIT: Once = Once::new();
680
681
+ // Probe for certificate stores the first time an easy handle is created,
682
+ // and re-use the results for subsequent handles.
683
+ let probe = INIT.call_once(|| unsafe {
684
+ PROBE = Some(::openssl_probe::probe());
685
+ PROBE.as_ref().unwrap()
686
+ });
687
688
if let Some(ref path) = probe.cert_file {
689
let _ = self.cainfo(path);
690
}
0 commit comments