How to connect to an imap server using an ssl certificate in php?
===

I need to connect to a mail server which has a an ssl certificate. I am able to connect to the server using the following code:

    imap_open ("{localhost:993/imap/ssl/novalidate-cert}", "user_id", "password");

But this would ignore or skip validation of the certificate. How can i enable validation of the certificate?

Using the following code as per the php manual gives me an invalid certificate error.

    imap_open ("{localhost:993/imap/ssl}", "user_id", "password");

What am I doing wrong?