Bump to rustls 0.22
This commit is contained in:
@@ -33,9 +33,10 @@ utils = { path = "../crates/utils", features = ["test_mode"] }
|
||||
jmap-client = { git = "https://github.com/stalwartlabs/jmap-client", features = ["websockets", "debug", "async"] }
|
||||
mail-parser = { git = "https://github.com/stalwartlabs/mail-parser", features = ["full_encoding", "serde_support", "ludicrous_mode"] }
|
||||
tokio = { version = "1.23", features = ["full"] }
|
||||
tokio-rustls = { version = "0.24.0"}
|
||||
rustls = "0.21.0"
|
||||
tokio-rustls = { version = "0.25.0"}
|
||||
rustls = "0.22"
|
||||
rustls-pemfile = "2.0"
|
||||
rustls-pki-types = { version = "1" }
|
||||
csv = "1.1"
|
||||
rayon = { version = "1.5.1" }
|
||||
flate2 = { version = "1.0.17", features = ["zlib"], default-features = false }
|
||||
|
||||
@@ -29,8 +29,9 @@ pub mod sql;
|
||||
use ::smtp::core::Lookup;
|
||||
use directory::{config::ConfigDirectory, AddressMapping, Directories};
|
||||
use mail_send::Credentials;
|
||||
use rustls::{Certificate, PrivateKey, ServerConfig};
|
||||
use rustls::ServerConfig;
|
||||
use rustls_pemfile::{certs, pkcs8_private_keys};
|
||||
use rustls_pki_types::PrivateKeyDer;
|
||||
use std::{borrow::Cow, io::BufReader, path::PathBuf, sync::Arc};
|
||||
use store::{config::ConfigStore, LookupStore, Stores};
|
||||
use tokio_rustls::TlsAcceptor;
|
||||
@@ -367,20 +368,16 @@ XzVV5pwOxkIDBWDIqMUfwJDChBKfpw==
|
||||
|
||||
pub fn dummy_tls_acceptor() -> Arc<TlsAcceptor> {
|
||||
// Init server config builder with safe defaults
|
||||
let config = ServerConfig::builder()
|
||||
.with_safe_defaults()
|
||||
.with_no_client_auth();
|
||||
let config = ServerConfig::builder().with_no_client_auth();
|
||||
|
||||
// load TLS key/cert files
|
||||
let cert_file = &mut BufReader::new(CERT.as_bytes());
|
||||
let key_file = &mut BufReader::new(PK.as_bytes());
|
||||
|
||||
// convert files to key/cert objects
|
||||
let cert_chain = certs(cert_file)
|
||||
.map(|v| Certificate(v.unwrap().as_ref().to_vec()))
|
||||
.collect();
|
||||
let mut keys: Vec<PrivateKey> = pkcs8_private_keys(key_file)
|
||||
.map(|v| PrivateKey(v.unwrap().secret_pkcs8_der().to_vec()))
|
||||
let cert_chain = certs(cert_file).map(|r| r.unwrap()).collect();
|
||||
let mut keys: Vec<PrivateKeyDer> = pkcs8_private_keys(key_file)
|
||||
.map(|v| PrivateKeyDer::Pkcs8(v.unwrap()))
|
||||
.collect();
|
||||
|
||||
// exit if no keys could be parsed
|
||||
|
||||
@@ -25,7 +25,7 @@ use std::time::Duration;
|
||||
|
||||
use imap_proto::ResponseType;
|
||||
use mail_send::smtp::tls::build_tls_connector;
|
||||
use rustls::ServerName;
|
||||
use rustls_pki_types::ServerName;
|
||||
use tokio::{
|
||||
io::{AsyncBufReadExt, AsyncWriteExt, BufReader, Lines, ReadHalf, WriteHalf},
|
||||
net::TcpStream,
|
||||
@@ -164,7 +164,7 @@ impl SieveConnection {
|
||||
let (reader, writer) = tokio::io::split(
|
||||
build_tls_connector(true)
|
||||
.connect(
|
||||
ServerName::try_from("imap.example.org").unwrap(),
|
||||
ServerName::try_from("imap.example.org").unwrap().to_owned(),
|
||||
TcpStream::connect("127.0.0.1:4190").await.unwrap(),
|
||||
)
|
||||
.await
|
||||
|
||||
@@ -44,7 +44,7 @@ use mail_auth::{
|
||||
report::tlsrpt::ResultType,
|
||||
Resolver, MX,
|
||||
};
|
||||
use rustls::Certificate;
|
||||
use rustls_pki_types::CertificateDer;
|
||||
use utils::config::ServerProtocol;
|
||||
|
||||
use crate::smtp::{
|
||||
@@ -304,7 +304,7 @@ async fn dane_test() {
|
||||
let mut file = path.clone();
|
||||
file.push(format!("{host}.{num}.cert"));
|
||||
if file.exists() {
|
||||
certs.push(Certificate(fs::read(file).unwrap()));
|
||||
certs.push(CertificateDer::from(fs::read(file).unwrap()));
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user