diff --git a/openssl-sys/Cargo.toml b/openssl-sys/Cargo.toml index 4b3ce6c8d1..3c24a20fb1 100644 --- a/openssl-sys/Cargo.toml +++ b/openssl-sys/Cargo.toml @@ -25,7 +25,7 @@ bssl-sys = { version = "0.1.0", optional = true } [build-dependencies] bindgen = { version = "0.65.0", optional = true, features = ["experimental"] } cc = "1.0.61" -openssl-src = { version = "300.1.2", optional = true, features = ["legacy"] } +openssl-src = { version = "300.2.0", optional = true, features = ["legacy"] } pkg-config = "0.3.9" vcpkg = "0.2.8" diff --git a/openssl-sys/build/find_vendored.rs b/openssl-sys/build/find_vendored.rs index c92b2bd39b..57a5cbf1ce 100644 --- a/openssl-sys/build/find_vendored.rs +++ b/openssl-sys/build/find_vendored.rs @@ -1,8 +1,17 @@ use openssl_src; use std::path::PathBuf; +use super::env; + pub fn get_openssl(_target: &str) -> (Vec, PathBuf) { - let artifacts = openssl_src::Build::new().build(); + let openssl_dir = env("OPENSSL_DIR"); + + let mut openssl_src_build = openssl_src::Build::new(); + if let Some(value) = openssl_dir { + openssl_src_build.openssl_dir(PathBuf::from(value)); + } + + let artifacts = openssl_src_build.build(); println!("cargo:vendored=1"); println!( "cargo:root={}",