Fetchmail and OpenSSL: fixing certificate errors by pinning a fingerprint or by trusting the certificate chain.

2 notes
Fetchmail OpenSSL error Fix fetchmail OpenSSL errors by adding the server's certificate fingerprint to .fetchmailrc.Aug 24, 2022
Fetchmail OpenSSL error, part 2 Make fetchmail verify certificates on Fedora 36: save the certificate chain and create c_rehash links.Aug 24, 2022
README.md PDF

📥 Fetchmail

Fetchmail collects mail from a POP3 or IMAP server and hands it to your local mail system. Sometimes it refuses the mail server’s certificate with an OpenSSL error. Two ways to fix that:

  1. Fetchmail OpenSSL error, part 1: pin the server’s certificate fingerprint in .fetchmailrc. Quick, but it breaks again whenever the certificate is renewed.
  2. Fetchmail OpenSSL error, part 2: let fetchmail verify the certificate properly, by saving the certificate chain and creating c_rehash links. More work once, then it keeps working.

⚡ See what the server sends

# the certificate chain of an IMAP server (port 993)
openssl s_client -connect mail.example.org:993 -showcerts </dev/null
# its SHA-256 fingerprint, for part 1
openssl s_client -connect mail.example.org:993 </dev/null 2>/dev/null \
    | openssl x509 -noout -fingerprint -sha256
fetchmail -v -c                     # check for mail without fetching, with details