Skip to content

Commit

Permalink
Update rustls to 0.23 and tokio-rustls to 0.26
Browse files Browse the repository at this point in the history
In addition we now use aws_lc_rs instead of ring which is new default crypto provider in rustls
  • Loading branch information
Abdullah Alyan committed Mar 25, 2024
1 parent bd26ca4 commit ec945fb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ rmp-serde = { version = "1", optional = true }
uuid_ = { package = "uuid", version = "1", optional = true, features = ["serde"] }

# Optional TLS dependencies
rustls = { version = "0.22", optional = true }
tokio-rustls = { version = "0.25", optional = true }
rustls = { version = "0.23", optional = true }
tokio-rustls = { version = "0.26", optional = true }
rustls-pemfile = { version = "2.0.0", optional = true }

# Optional MTLS dependencies
Expand Down
4 changes: 2 additions & 2 deletions core/lib/src/listener/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl TlsConfig {
pub(crate) fn server_config(&self) -> Result<ServerConfig, Error> {
let provider = rustls::crypto::CryptoProvider {
cipher_suites: self.ciphers().map(|c| c.into()).collect(),
..rustls::crypto::ring::default_provider()
..rustls::crypto::aws_lc_rs::default_provider()
};

#[cfg(feature = "mtls")]
Expand Down Expand Up @@ -59,7 +59,7 @@ impl TlsConfig {

tls_config.ignore_client_order = self.prefer_server_cipher_order;
tls_config.session_storage = ServerSessionMemoryCache::new(1024);
tls_config.ticketer = rustls::crypto::ring::Ticketer::new()?;
tls_config.ticketer = rustls::crypto::aws_lc_rs::Ticketer::new()?;
tls_config.alpn_protocols = vec![b"http/1.1".to_vec()];
if cfg!(feature = "http2") {
tls_config.alpn_protocols.insert(0, b"h2".to_vec());
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/tls/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ impl CipherSuite {

impl From<CipherSuite> for rustls::SupportedCipherSuite {
fn from(cipher: CipherSuite) -> Self {
use rustls::crypto::ring::cipher_suite;
use rustls::crypto::aws_lc_rs::cipher_suite;

match cipher {
CipherSuite::TLS_CHACHA20_POLY1305_SHA256 =>
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/tls/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fn load_key(reader: &mut dyn io::BufRead) -> Result<PrivateKeyDer<'static>>

// Ensure we can use the key.
let key = keys.remove(0);
rustls::crypto::ring::sign::any_supported_type(&key).map_err(KeyError::Unsupported)?;
rustls::crypto::aws_lc_rs::sign::any_supported_type(&key).map_err(KeyError::Unsupported)?;
Ok(key)
}

Expand Down

0 comments on commit ec945fb

Please sign in to comment.