Repository navigation
fix: trust self-signed server certificates and separate connection errors - #58
Merged
Merged
Conversation
…rors
A local Proton Mail Bridge presents a self-signed certificate, which rustls
refused during the handshake. The setup wizard then blamed the password for
every failed check, so a correct login looked rejected.
- Run the TLS handshake eagerly with a verifier that falls back to
user-trusted SHA-256 fingerprints when web PKI verification fails;
refusals surface as CoreError::UntrustedCertificate (server, reason,
fingerprint) instead of an anonymous I/O error.
- New health outcome `untrusted`: red at once, never blamed on the password.
- Trusted fingerprints are stored per account (`trustedCertificates`) and
published as `trusted_certificates` in both connection blocks.
- The wizard shows a certificate step with a warning and the fingerprint
("Trust and Add"); the account detail offers the same decision when a
certificate changes.
- Separate wizard messages for rejected login, unreachable server, failed
encryption, and other failures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Problem
Adding a Proton Mail Bridge account (
127.0.0.1:1143, STARTTLS) failed even with the exact credentials from the Bridge. The Bridge presents a self-signed certificate. rustls refused it during the handshake, and the setup wizard then showed "The server did not accept these details. Check the password…" for every failed check. A correct login looked rejected, and nothing pointed to the certificate.Changes
TLS (
torromail-imap-tls)CoreError::UntrustedCertificate { server, reason, sha256 }instead of an anonymous I/O error.unknown_issuer(self-signed, includingCaUsedAsEndEntity),expired,not_yet_valid,wrong_name,invalid.Health / check
untrusted, added to the shared contractcontracts/health-derive.json. It turns the dot red at once, the same way a refused login does, but is never reported as a password problem.Configuration
MailAccount.trustedCertificatesis stored instate.json, in both the Swift and Rust models.trusted_certificatesin both the IMAP and SMTP blocks. A malformed list fails closed.App
TUI
untrustedand shows it as its own message. It has no trust action yet.Tests
cargo test --workspace: 410 passedcrates/torromail-imap-tls/tests/trusted_certificates.rs, run against an in-process TLS server with a self-signedCA:TRUEfixture:TorroMailKitContractpasses: certificate parsing and cause classificationswift buildpasses0D:FD:C9:…:AC:24; trusted → login OK; Gmail unaffectedNot yet tested
🤖 Generated with Claude Code