diff --git a/Cargo.lock b/Cargo.lock index 4c49f2fdf0a..9f1183b0c53 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3665,6 +3665,7 @@ dependencies = [ "msg", "net_traits", "openssl", + "openssl-sys", "percent-encoding", "pixels", "profile_traits", diff --git a/components/net/Cargo.toml b/components/net/Cargo.toml index 2c6513e44b1..7e3073bf123 100644 --- a/components/net/Cargo.toml +++ b/components/net/Cargo.toml @@ -6,6 +6,7 @@ license = "MPL-2.0" edition = "2018" publish = false autotests = false # Inhibit lookup for tests/*.rs without [[test]] sections +build = "build.rs" [lib] name = "net" @@ -43,6 +44,7 @@ mime_guess = "2.0.0-alpha.6" msg = {path = "../msg"} net_traits = {path = "../net_traits"} openssl = "0.10" +openssl-sys = "0.9" percent-encoding = "2.0" pixels = {path = "../pixels"} profile_traits = {path = "../profile_traits"} diff --git a/components/net/build.rs b/components/net/build.rs new file mode 100644 index 00000000000..4a75c1b4bbb --- /dev/null +++ b/components/net/build.rs @@ -0,0 +1,16 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +fn main() { + let version = + std::env::var("DEP_OPENSSL_VERSION_NUMBER").expect("missing DEP_OPENSSL_VERSION_NUMBER"); + let actual = u64::from_str_radix(&version, 16).unwrap(); + let minimum = 0x10101000; + if actual < minimum { + panic!( + "Your OpenSSL version is older than 1.1.1 ({:x}), you have: {:x}", + minimum, actual + ); + } +}