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 fce9ed4Copy full SHA for fce9ed4
src/easy/handler.rs
@@ -673,7 +673,20 @@ 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
+ INIT.call_once(|| unsafe {
684
+ PROBE = Some(::openssl_probe::probe());
685
+ });
686
+ let probe = unsafe {
687
+ PROBE.as_ref().unwrap()
688
+ };
689
690
if let Some(ref path) = probe.cert_file {
691
let _ = self.cainfo(path);
692
}
0 commit comments