Skip to content

feat: support underscore-prefixed domains with self-signed TLS certificates#7926

Open
hpk42 wants to merge 6 commits intolink2xt/rustls-underscorefrom
hpk/underdomains
Open

feat: support underscore-prefixed domains with self-signed TLS certificates#7926
hpk42 wants to merge 6 commits intolink2xt/rustls-underscorefrom
hpk/underdomains

Conversation

@hpk42
Copy link
Contributor

@hpk42 hpk42 commented Mar 1, 2026

Allow Delta Chat core to work with chatmail servers running on underscore-prefixed domains (e.g. _alice.example.org) which use self-signed TLS certificates. This is mirroring related work on chatmail relays: chatmail/relay#855 . Underscore domains with self-signed TLS certs can be used by LXC containers on local networks where obtaining real certificates is not practical.

When the domain starts with '_', certificate verification is automatically relaxed for IMAP/SMTP connections, dcaccount QR code handling, and iroh relay endpoints. The Python test suite is adapted to also work against such underscore-domain servers, including cross-core tests with older Delta Chat versions.

Note: this PR does not support HTTPS requests with underscore domains. They are not currently needed for working with LXC test containers, and introducing support would not only require some boilerplate with TLS connections but also a deeper look at how hyper performs http requests. It's best left for a separate consideration. This PR also does not make Iroh work with underscore domains. It would draw in dependencies and that is best considered in a separate PR.

Note2: i also fixed some resource loading in tests, because i ran into issues as i wasn't running tests from deltachat-rpc-client directory but repo root.

@hpk42 hpk42 force-pushed the hpk/underdomains branch from 61b97c1 to 5e90657 Compare March 2, 2026 12:01
…icates

Allow Delta Chat core to work with chatmail servers running on
underscore-prefixed domains (e.g. _alice.localchat) which use
self-signed TLS certificates. This is mirroring related work
on chatmail relays: chatmail/relay#855
Underscore domains with self-signed TLS certs can be used by LXC test
containers where obtaining real certificates is not practical.

When the domain starts with '_', certificate verification is
automatically relaxed for IMAP/SMTP connections, dcaccount QR
code handling, and iroh relay endpoints. The Python test suite
is adapted to also work against such underscore-domain servers,
including cross-core tests with older Delta Chat versions.

Note: this PR does not support HTTPS requests with underscore
domains. They are not currently needed for working with LXC test
containers.

14 files changed, +102/-31 lines (excluding Cargo.lock).
Cargo.lock: +606/-11 lines from enabling iroh features
needed for connecting to iroh relay endpoint on underscore domains.
The added dependencies are unfortunate but best considered
when finally upgrading to iroh 1.0 (tm).
@hpk42 hpk42 force-pushed the hpk/underdomains branch from 5e90657 to d9623a6 Compare March 2, 2026 18:50
…ead of AcceptInvalidCertificates

Remove AcceptInvalidCertificates overrides in configure.rs and qr.rs that
caused a fallback to OpenSSL/native-tls. The upstream Rustls TLS layer now
handles underscore-prefixed domains via NoCertificateVerification directly.
Also fix clippy lint in peer_channels.rs (map_or -> is_some_and).
@hpk42 hpk42 force-pushed the hpk/underdomains branch from d9623a6 to 0f8a349 Compare March 2, 2026 18:54
@hpk42 hpk42 force-pushed the hpk/underdomains branch 2 times, most recently from 97de2ae to b0a66e5 Compare March 4, 2026 09:59
@hpk42 hpk42 force-pushed the hpk/underdomains branch from b0a66e5 to cc74488 Compare March 4, 2026 10:03
@link2xt link2xt changed the base branch from main to link2xt/rustls-underscore March 4, 2026 17:44
@link2xt link2xt force-pushed the link2xt/rustls-underscore branch 2 times, most recently from d31f931 to e40d4fd Compare March 4, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants