ACME TLS implementation using TLS-ALPN-01 - closes #160
This commit is contained in:
@@ -276,7 +276,7 @@ async fn init_imap_tests(store_id: &str, delete_if_exists: bool) -> IMAPTest {
|
||||
.replace("{TMP}", &temp_dir.path.display().to_string()),
|
||||
)
|
||||
.unwrap();
|
||||
let servers = config.parse_servers().unwrap();
|
||||
let mut servers = config.parse_servers().unwrap();
|
||||
let stores = config.parse_stores().await.failed("Invalid configuration");
|
||||
let directory = config
|
||||
.parse_directory(&stores, store_id.into())
|
||||
@@ -289,9 +289,16 @@ async fn init_imap_tests(store_id: &str, delete_if_exists: bool) -> IMAPTest {
|
||||
let smtp = SMTP::init(&config, &servers, &stores, &directory, delivery_tx)
|
||||
.await
|
||||
.failed("Invalid configuration file");
|
||||
let jmap = JMAP::init(&config, &stores, &directory, delivery_rx, smtp.clone())
|
||||
.await
|
||||
.failed("Invalid configuration file");
|
||||
let jmap = JMAP::init(
|
||||
&config,
|
||||
&stores,
|
||||
&directory,
|
||||
std::mem::take(&mut servers.certificates),
|
||||
delivery_rx,
|
||||
smtp.clone(),
|
||||
)
|
||||
.await
|
||||
.failed("Invalid configuration file");
|
||||
let imap: Arc<IMAP> = IMAP::init(&config)
|
||||
.await
|
||||
.failed("Invalid configuration file");
|
||||
|
||||
@@ -390,7 +390,7 @@ async fn init_jmap_tests(store_id: &str, delete_if_exists: bool) -> JMAPTest {
|
||||
.replace("{TMP}", &temp_dir.path.display().to_string()),
|
||||
)
|
||||
.unwrap();
|
||||
let servers = config.parse_servers().unwrap();
|
||||
let mut servers = config.parse_servers().unwrap();
|
||||
let stores = config.parse_stores().await.failed("Invalid configuration");
|
||||
let directory = config
|
||||
.parse_directory(&stores, store_id.into())
|
||||
@@ -403,9 +403,16 @@ async fn init_jmap_tests(store_id: &str, delete_if_exists: bool) -> JMAPTest {
|
||||
let smtp = SMTP::init(&config, &servers, &stores, &directory, delivery_tx)
|
||||
.await
|
||||
.failed("Invalid configuration file");
|
||||
let jmap = JMAP::init(&config, &stores, &directory, delivery_rx, smtp.clone())
|
||||
.await
|
||||
.failed("Invalid configuration file");
|
||||
let jmap = JMAP::init(
|
||||
&config,
|
||||
&stores,
|
||||
&directory,
|
||||
std::mem::take(&mut servers.certificates),
|
||||
delivery_rx,
|
||||
smtp.clone(),
|
||||
)
|
||||
.await
|
||||
.failed("Invalid configuration file");
|
||||
let (shutdown_tx, _) = servers.spawn(|server, shutdown_rx| {
|
||||
match &server.protocol {
|
||||
ServerProtocol::Smtp | ServerProtocol::Lmtp => {
|
||||
|
||||
@@ -296,11 +296,11 @@ impl utils::listener::SessionManager for SessionManager {
|
||||
TokioIo::new(
|
||||
session
|
||||
.instance
|
||||
.tls_acceptor
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.acceptor
|
||||
.accept(session.stream)
|
||||
.await
|
||||
.unwrap_tls()
|
||||
.await
|
||||
.unwrap(),
|
||||
),
|
||||
service_fn(|mut req: hyper::Request<body::Incoming>| {
|
||||
|
||||
@@ -37,7 +37,10 @@ use store::{
|
||||
};
|
||||
use tokio::net::TcpSocket;
|
||||
|
||||
use utils::config::{Config, DynValue, KeyLookup, Listener, Rate, Server, ServerProtocol};
|
||||
use utils::{
|
||||
config::{Config, DynValue, KeyLookup, Listener, Rate, Server, ServerProtocol},
|
||||
listener::TcpAcceptor,
|
||||
};
|
||||
|
||||
use ahash::AHashMap;
|
||||
|
||||
@@ -449,7 +452,7 @@ fn parse_servers() {
|
||||
linger: None,
|
||||
nodelay: true,
|
||||
}],
|
||||
tls: None,
|
||||
acceptor: TcpAcceptor::Plain,
|
||||
tls_implicit: false,
|
||||
max_connections: 8192,
|
||||
},
|
||||
@@ -477,7 +480,7 @@ fn parse_servers() {
|
||||
nodelay: true,
|
||||
},
|
||||
],
|
||||
tls: None,
|
||||
acceptor: TcpAcceptor::Plain,
|
||||
tls_implicit: true,
|
||||
max_connections: 1024,
|
||||
},
|
||||
@@ -495,7 +498,7 @@ fn parse_servers() {
|
||||
linger: None,
|
||||
nodelay: true,
|
||||
}],
|
||||
tls: None,
|
||||
acceptor: TcpAcceptor::Plain,
|
||||
tls_implicit: true,
|
||||
max_connections: 8192,
|
||||
},
|
||||
|
||||
@@ -34,7 +34,7 @@ use smtp::{
|
||||
};
|
||||
use utils::{
|
||||
config::ServerProtocol,
|
||||
listener::{limiter::ConcurrencyLimiter, ServerInstance},
|
||||
listener::{limiter::ConcurrencyLimiter, ServerInstance, TcpAcceptor},
|
||||
};
|
||||
|
||||
use super::TestConfig;
|
||||
@@ -368,7 +368,7 @@ impl TestServerInstance for ServerInstance {
|
||||
hostname: "mx.example.org".to_string(),
|
||||
protocol: ServerProtocol::Smtp,
|
||||
data: "220 mx.example.org at your service.\r\n".to_string(),
|
||||
tls_acceptor: None,
|
||||
acceptor: TcpAcceptor::Plain,
|
||||
is_tls_implicit: false,
|
||||
limiter: ConcurrencyLimiter::new(100),
|
||||
shutdown_rx,
|
||||
|
||||
Reference in New Issue
Block a user