Repository navigation
Conversation
Every account connection now builds its TLS config in a shared crate. When the platform refuses a certificate, the handshake fails with the certificate and the reason, and a person can accept that exact certificate for that server.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Servers with a company certificate authority, a self-signed certificate or a certificate made for another name could not be used at all. Penguin Mail now shows the certificate and lets the person accept it, as Thunderbird does.
What changes for a person
What is accepted
Exactly one certificate for one host and port on one account: the SHA-256 of the leaf certificate's DER. It is not a CA, not a wildcard and not "skip checks for this server". The handshake signature checks still run. Removing the account removes its pins.
It covers IMAP, SMTP, POP3, ManageSieve, CalDAV and CardDAV. Discovery, Google and Microsoft sign-in and API hosts, JMAP, the web and update checks keep the platform check only and offer nothing. A CalDAV or CardDAV client that signs in with a bearer token is rebuilt without the pin config, so a Google or Microsoft host never offers it.
The 127.0.0.1 Proton Bridge pin works as before.
How it works
mailrs-tlsbuilds theClientConfigfor every account connection. Its verifier checks the pin first, then the platform verifier. When the platform refuses, the handshake fails with a typedCertIssue(leaf DER, reason, the previous pin if any). Each protocol error gains aCertificatevariant that carries it; reqwest errors are searched through their causes.account_certificates, migration 77, deleted with the account) and load into a process-wide list at start. A pin in that list is matched by host and port, so one account's pin also satisfies another account that reaches the same host and port with the same certificate.NeedsCertificateaccount state, and an in-memory note of the certificate each account waits on, drive the banner.x509-parser0.18 is new (Rusticata project, pure Rust, the usual choice for reading certificates; nothing in the tree parsed names, issuers or dates).rcgenis a test-only dependency (rustls project). No package of the trusted families applies, since this is Rust.Not done: a settings page listing pins, and the accepted fingerprint in the server settings (no natural place there). Both are outside what the issue asked.
Checked
mailrs-tls, and a CalDAV client through reqwest.mailrs_imap::checkstops at the IMAP certificate, then at the SMTP one, and passes once both are accepted. A sync test does the first sync and sends one message after accepting.Fixes #207