Skip to content

Commit

Permalink
Merge pull request #1886 from algesten/fix/ssl-methods
Browse files Browse the repository at this point in the history
DTLS1 and DTLS1_2 SslVersion for set_min_proto_version()
  • Loading branch information
sfackler committed Apr 18, 2023
2 parents 62189c1 + 36fd965 commit 7206466
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openssl-sys/src/tls1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ pub const TLS1_2_VERSION: c_int = 0x303;
#[cfg(any(ossl111, libressl340))]
pub const TLS1_3_VERSION: c_int = 0x304;

pub const DTLS1_VERSION: c_int = 0xFEFF;
#[cfg(any(ossl102, libressl332))]
pub const DTLS1_2_VERSION: c_int = 0xFEFD;

pub const TLS1_AD_DECODE_ERROR: c_int = 50;
pub const TLS1_AD_UNRECOGNIZED_NAME: c_int = 112;

Expand Down
11 changes: 11 additions & 0 deletions openssl/src/ssl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,17 @@ impl SslVersion {
/// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
#[cfg(any(ossl111, libressl340))]
pub const TLS1_3: SslVersion = SslVersion(ffi::TLS1_3_VERSION);

/// DTLSv1.0
///
/// DTLS 1.0 corresponds to TLS 1.1.
pub const DTLS1: SslVersion = SslVersion(ffi::DTLS1_VERSION);

/// DTLSv1.2
///
/// DTLS 1.2 corresponds to TLS 1.2 to harmonize versions. There was never a DTLS 1.1.
#[cfg(any(ossl102, libressl332))]
pub const DTLS1_2: SslVersion = SslVersion(ffi::DTLS1_2_VERSION);
}

cfg_if! {
Expand Down

0 comments on commit 7206466

Please sign in to comment.