May
28
|
Recently was setting up clients iPhone to access our mail servers using IMAP over SSL. Problem was we kept getting an error say that the username or password were incorrect. The username and password entered in the iPhone setup were correct. Using the identical setup to access the same email account from my iPhone worked fine.
Fortunately we had setup the phone so that all it’s data was either being accessed or synced from the cloud so resetting the phone was no drama. Unfortunately resetting his phone didn’t make any difference, still could not connect.
After increasing the logging on the mail server it was discovered the issue was that the iPhone did not have the required SSL certificate installed to make the required connection. The reason my iPhone worked I think is because I sync mine with a Mac whereas the phone that could not connect was syncing with a Windows box. Am assuming that the syncing with the Mac copied the certificate to my iPhone for me, but have not confirmed this.
To install the certificate we took the following steps.
-
Create a DER format certificate
iPhone does not understand PEM (Privacy-Enhanced Mail) formatted certificates and instead expects the certificate to be in DER (Distinguished Encoding Rules) format. So we need to create a DER version of the mail certificate on the server using openssl.
openssl x509 -in /etc/ssl/certs/ssl-mail.pem -inform PEM -out mail.der -outform DER
-
Copy the DER certificate so it is accessible from your web server
-
Open the certificate on your iPhone
Using Safari on the iPhone open the certificate that you just created. You will be prompted if you want to install the certificate. Press the “Install” button to install the certificate on your iPhone.
-
Reboot your iPhone
After restarting the iPhone the certificate should be available and you will be able to connect to the mail server using SSL without any problems.
Array ( ) 6 Responses to “Problems connecting iPhone to IMAP mail server”
Leave a Reply
You must be logged in to post a comment.
May 29th, 2010 at 3:16 pm
Great detailed information, I just bookmarked you on my google reader
Sent from my Android phone
June 5th, 2010 at 6:33 pm
Hello there, I just noticed this site (again!) so this time I thought’d I’d say thanks for the intersting site! Keep it up!
June 5th, 2010 at 6:44 pm
Thanks
October 16th, 2010 at 6:07 am
Sorry.. but how do you actually create the DER format certificate?
Thanks
October 18th, 2010 at 2:21 pm
The command to generate the DER format certificate can be found in step 1. above
April 3rd, 2011 at 5:02 am
Merely wanna admit that this is extremely helpful, Thanks for taking your time to write this.