Merge pull request #1324 from orium/fix-1293-openssl-no-atexit
Make openssl not cleanup at exit, which could lead to race conditions.
This commit is contained in:
commit
08d8367ff2
|
|
@ -101,8 +101,13 @@ pub fn init() {
|
||||||
// explicitly initialize to work around https://github.com/openssl/openssl/issues/3505
|
// explicitly initialize to work around https://github.com/openssl/openssl/issues/3505
|
||||||
static INIT: Once = Once::new();
|
static INIT: Once = Once::new();
|
||||||
|
|
||||||
|
#[cfg(not(ossl111b))]
|
||||||
|
let init_options = OPENSSL_INIT_LOAD_SSL_STRINGS;
|
||||||
|
#[cfg(ossl111b)]
|
||||||
|
let init_options = OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_NO_ATEXIT;
|
||||||
|
|
||||||
INIT.call_once(|| unsafe {
|
INIT.call_once(|| unsafe {
|
||||||
OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, ptr::null_mut());
|
OPENSSL_init_ssl(init_options, ptr::null_mut());
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1398,6 +1398,8 @@ cfg_if! {
|
||||||
|
|
||||||
#[cfg(ossl110)]
|
#[cfg(ossl110)]
|
||||||
pub const OPENSSL_INIT_LOAD_SSL_STRINGS: u64 = 0x00200000;
|
pub const OPENSSL_INIT_LOAD_SSL_STRINGS: u64 = 0x00200000;
|
||||||
|
#[cfg(ossl111b)]
|
||||||
|
pub const OPENSSL_INIT_NO_ATEXIT: u64 = 0x00080000;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#[cfg(ossl110)]
|
#[cfg(ossl110)]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue