{"id":17,"date":"2009-05-19T16:55:32","date_gmt":"2009-05-19T16:55:32","guid":{"rendered":"http:\/\/www.coolfactor.org\/blog\/2009\/05\/19\/imap-smtp-tls-and-certificates\/"},"modified":"2009-05-19T16:55:32","modified_gmt":"2009-05-19T16:55:32","slug":"imap-smtp-tls-and-certificates","status":"publish","type":"post","link":"http:\/\/www.coolfactor.org\/blog\/2009\/05\/19\/imap-smtp-tls-and-certificates\/","title":{"rendered":"IMAP, SMTP, TLS and certificates"},"content":{"rendered":"<p>A couple of years ago I had a good go at getting my Sony Ericsson phone to talk to my IMAP server over SSL. That much worked (although the IMAP client doesn&#8217;t support folders so I had to do a bit of a bodge with multiple user accounts and symlinks in cyrus to get at important folders) but I could never get authenticated SMTP over TLS to work.<\/p>\n<p>Today I cracked it.<br \/>\n<!--more--><\/p>\n<p>The thing that was standing in the way turned out to be that I&#8217;m using a certificate that the phone doesn&#8217;t trust. That&#8217;s no surprise really, since I created my own Certificate Authority and there&#8217;s no reason for anybody else to trust it.<\/p>\n<p>The tricky part was persuading the phone to recognise it. It allows you to accept an untrusted certificate for IMAP, but won&#8217;t give you the option for SMTP.<\/p>\n<p>Luckily, it is actually possible to give the phone the new certificate. The first step is to convert the certificate to DER format.<\/p>\n<p><code>openssl x509 -in pemfile.pem -inform PEM -out derfile.crt -outform DER<\/code><\/p>\n<p>(courtesy of a post on the cacert-support mailing list)<\/p>\n<p>Then derfile.crt needs to end up in a directory served up by a web server.<\/p>\n<p>Pointing the phone&#8217;s browser at this file allowed me to save the certificate.<\/p>\n<p>After that, authenticated SMTP with TLS magically started working.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A couple of years ago I had a good go at getting my Sony Ericsson phone to talk to my IMAP server over SSL. That much worked (although the IMAP client doesn&#8217;t support folders so I had to do a &hellip; <a href=\"http:\/\/www.coolfactor.org\/blog\/2009\/05\/19\/imap-smtp-tls-and-certificates\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/www.coolfactor.org\/blog\/wp-json\/wp\/v2\/posts\/17"}],"collection":[{"href":"http:\/\/www.coolfactor.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.coolfactor.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.coolfactor.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.coolfactor.org\/blog\/wp-json\/wp\/v2\/comments?post=17"}],"version-history":[{"count":0,"href":"http:\/\/www.coolfactor.org\/blog\/wp-json\/wp\/v2\/posts\/17\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.coolfactor.org\/blog\/wp-json\/wp\/v2\/media?parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.coolfactor.org\/blog\/wp-json\/wp\/v2\/categories?post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.coolfactor.org\/blog\/wp-json\/wp\/v2\/tags?post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}