Skip to content

Commit 9b14a65

Browse files
Add support of openssl 1.1.1
* See issue #758 Signed-off-by: Florentin Dubois <[email protected]>
1 parent 1b3cd3c commit 9b14a65

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

lib/build.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
use std::env;
22

33
fn main() {
4-
match env::var("DEP_OPENSSL_VERSION") {
5-
Ok(ref v) if v == "101" => {
6-
println!("cargo:rustc-cfg=ossl101");
4+
match &env::var("DEP_OPENSSL_VERSION") {
5+
Ok(v) if v == "101" || v == "102" => {
6+
println!("cargo:rustc-cfg=ossl{}", v);
77
println!("cargo:rustc-cfg=ossl10x");
88
}
9-
Ok(ref v) if v == "102" => {
10-
println!("cargo:rustc-cfg=ossl102");
11-
println!("cargo:rustc-cfg=ossl10x");
12-
}
13-
Ok(ref v) if v == "110" => {
14-
println!("cargo:rustc-cfg=ossl110");
9+
Ok(v) if v == "110" || v == "111" => {
10+
println!("cargo:rustc-cfg=ossl{}", v);
11+
println!("cargo:rustc-cfg=ossl11x");
1512
}
1613
_ => {
17-
println!("cargo:rustc-cfg=ossl110");
14+
println!("cargo:rustc-cfg=ossl111");
15+
println!("cargo:rustc-cfg=ossl11x");
1816
} //panic!("Unable to detect OpenSSL version"),
1917
}
2018

lib/src/https_openssl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,15 +2381,15 @@ fn setup_curves(ctx: &mut SslContextBuilder) -> Result<(), ErrorStack> {
23812381
ctx.set_ecdh_auto(true)
23822382
}
23832383

2384-
#[cfg(ossl110)]
2384+
#[cfg(ossl11x)]
23852385
fn setup_curves(ctx: &mut SslContextBuilder) -> Result<(), ErrorStack> {
23862386
use openssl::ec::EcKey;
23872387

23882388
let curve = EcKey::from_curve_name(nid::Nid::X9_62_PRIME256V1)?;
23892389
ctx.set_tmp_ecdh(&curve)
23902390
}
23912391

2392-
#[cfg(all(not(ossl101), not(ossl102), not(ossl110)))]
2392+
#[cfg(all(not(ossl101), not(ossl102), not(ossl11x)))]
23932393
fn setup_curves(_: &mut SslContextBuilder) -> Result<(), ErrorStack> {
23942394
compile_error!("unsupported openssl version, please open an issue");
23952395
Ok(())

0 commit comments

Comments
 (0)