I'd like to tell Macos 10.4 Mail that it can trust a self-signed SSL certificate for an IMAP+SMTP/SSL connection to a mail server I run, so that Mail does not complain each time I fetch mail.

Can this be done?


So this is how I add a Verisign intermediate cert to my desktops. I think the same would work for your self-signed cert. I put the file in /Library/Management/Certs/ on my target machines and then run the below script on them. That adds the cert to the system keychain.


/usr/bin/security add-certificates -k /Library/Keychains/System.keychain /Library/Management/Certs/VeriSign\ Class\ 3\ Secure\ Server\ CA.cer

  • +1 for directing me to security. I haven't got this to work yet: I have, so far, not generated a "DER encoded X509" representation of my certificate. FWIW, Macos 10.4 does not have a /Library/Management directory, but this should not matter. – Charles Stewart Feb 24 '10 at 15:17
  • Well, fancy that. I should have said I was prompted twice with Are You Sure messages before downloading mail. openssl x509 -inform PEM -outform DER allows me to add the certificate to System.keychain, and the first of the worried dialogs vanishes. But the second is still there, complaining "The root certificate for this server could not be verified"! – Charles Stewart Feb 24 '10 at 17:48
  • Accepted: my problem isn't solved, and I may be asking another, similar question, but this definitely imrpoved matters.... – Charles Stewart Mar 3 '10 at 14:01

To trust the root certificate, use:

sudo /usr/bin/security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain cacert.cer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.