Closed alexcrichton closed 2 years ago
openssl_sys::init is a no-op on versions that don't need explicit initialization, so you can probably just remove the check here entirely and call it unconditionally.
There's also DEP_OPENSSL_LIBRESSL_VERSION_NUMBER
if you care about supporting LibreSSL. Might be easier to invert the logic and only skip init if DEP_OPENSSL_VERSION_NUMBER
is defined and >= 1.1.0.
I dug a bit more into this but I think this incantation is close to what this crate wants. While it'd probably be fine to call the openssl-sys init function unconditionally I think now with #418 and setting the probed env vars first it's best to do that conditionally when only OpenSSL is in used since that's all that needs that I think. Otherwise the goal of this check is already to skip init business if it's >= 1.1.0, and init should only be called for 1.0.1 and prior (or w/e the version was before 1.1.0)
I also think we can skip libressl since the purpose of this is to set the openssl-probe env vars and I don't think that's necessary for libressl, or at least no one's ever complained about that.
As described in sfackler/rust-openssl#1548