From c68a3244deb84cf5062d3e2dceb9d4f2b42c07e5 Mon Sep 17 00:00:00 2001 From: Alexis Mousset Date: Wed, 16 Aug 2023 23:09:47 +0200 Subject: [PATCH] TLS 1.3 version support --- build.rs | 4 ++-- src/imp/schannel.rs | 1 - src/imp/security_framework.rs | 1 - src/lib.rs | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/build.rs b/build.rs index f0b6f7d5..4f9f63bc 100644 --- a/build.rs +++ b/build.rs @@ -22,8 +22,8 @@ fn main() { println!("cargo:rustc-cfg=have_min_max_version"); } - // TLS 1.3 requires libressl 3.2 - if version >= 0x3_02_01_00_0 { + // TLS 1.3 requires libressl 3.4.0 + if version >= 0x3_04_00_00_0 { println!("cargo:rustc-cfg=have_tls13_version"); } } diff --git a/src/imp/schannel.rs b/src/imp/schannel.rs index faeb5dcb..62e5042f 100644 --- a/src/imp/schannel.rs +++ b/src/imp/schannel.rs @@ -19,7 +19,6 @@ static PROTOCOLS: &'static [Protocol] = &[ Protocol::Tls10, Protocol::Tls11, Protocol::Tls12, - Protocol::Tls13, ]; fn convert_protocols(min: Option<::Protocol>, max: Option<::Protocol>) -> &'static [Protocol] { diff --git a/src/imp/security_framework.rs b/src/imp/security_framework.rs index 8a2489de..f56a916d 100644 --- a/src/imp/security_framework.rs +++ b/src/imp/security_framework.rs @@ -49,7 +49,6 @@ fn convert_protocol(protocol: Protocol) -> SslProtocol { Protocol::Tlsv10 => SslProtocol::TLS1, Protocol::Tlsv11 => SslProtocol::TLS11, Protocol::Tlsv12 => SslProtocol::TLS12, - Protocol::Tlsv13 => SslProtocol::TLS13, } } diff --git a/src/lib.rs b/src/lib.rs index 3fb5f2b7..8a3c4d19 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -323,7 +323,7 @@ pub enum Protocol { /// The TLS 1.2 protocol. Tlsv12, /// The TLS 1.3 protocol. - #[cfg(any(target_os = "macos", target_os = "windows", target_os = "ios", have_tls13_version))] + #[cfg(have_tls13_version)] Tlsv13, }