mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 23:16:30 +03:00
fix: do not request ALPN on standard ports and when using STARTTLS
Apparently some providers fail TLS connection with "no_application_protocol" alert even when requesting "imap" protocol for IMAP connection and "smtp" protocol for SMTP connection. Fixes <https://github.com/deltachat/deltachat-core-rust/issues/5892>.
This commit is contained in:
@@ -32,10 +32,10 @@ pub fn build_tls(strict_tls: bool, alpns: &[&str]) -> TlsConnector {
|
||||
pub async fn wrap_tls<T: AsyncRead + AsyncWrite + Unpin>(
|
||||
strict_tls: bool,
|
||||
hostname: &str,
|
||||
alpn: &str,
|
||||
alpn: &[&str],
|
||||
stream: T,
|
||||
) -> Result<TlsStream<T>> {
|
||||
let tls = build_tls(strict_tls, &[alpn]);
|
||||
let tls = build_tls(strict_tls, alpn);
|
||||
let tls_stream = tls.connect(hostname, stream).await?;
|
||||
Ok(tls_stream)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user