Skip to content

fix(mail): TLS SNI (Let's Encrypt) + implicit-TLS port coverage - #48

Merged
MalteKiefer merged 1 commit into
mainfrom
fix/mail-ports-tls
Jul 17, 2026
Merged

MalteKiefer merged 1 commit into
mainfrom
fix/mail-ports-tls

Conversation

@MalteKiefer

Copy link
Copy Markdown
Owner

Field-reported issues on the mail tab (mail.kiefer-networks.de):

  • TLS shown as "self-signed" for a real Let's Encrypt cert. The probe verified the cert against the dial address 127.0.0.1; the cert is issued for the public FQDN, so it never matched → mislabelled untrusted. Now checkPort verifies against the host FQDN (os.Hostname) for SNI while still dialing loopback → valid certs show trusted + real expiry.
  • Missing implicit-TLS ports. Added 465 (submissions) and 995 (pop3s). This server uses 25/465/993 (implicit TLS, no 587/143), so 465 was open but never probed.
  • Closed ports rendered alarming red. A closed optional port is informational → now a neutral chip.
  • Defensive: guard PeerCertificates[0] against an empty slice (no panic in the collector).

Verified: go build/GOOS=linux build/go vet/mail pkg tests, golangci-lint (linux) 0 issues, web lint+build clean.

Two field-reported issues:
- TLS certs (e.g. Let's Encrypt) were mislabelled "self-signed": the probe
  verified against the dial address (127.0.0.1) instead of the host FQDN, so a
  valid cert issued for the public hostname never matched. checkPort now takes a
  separate serverName (the host's FQDN via os.Hostname) for SNI + verification
  while still dialing loopback.
- Port coverage missed implicit-TLS ports: added 465 (submissions) and 995
  (pop3s) so a modern implicit-TLS setup (465/993 without 587/143) is shown.
- Web: a closed port now renders as a neutral chip instead of an alarming red
  "fail" — a closed optional port is informational, not an error.

Also guards PeerCertificates[0] against an empty slice (defensive, no panic in
the collector).
@MalteKiefer
MalteKiefer merged commit d541f77 into main Jul 17, 2026
10 of 11 checks passed
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.

1 participant