Page 1 of 1

IMAP error on localhost behind firewall?

Posted: Thu Sep 18, 2008 5:35 pm
by alex.barylski
I am trying to connect to GMail IMAP via my development server that sits behind a router using the following code:

Code: Select all

 
$mbox = imap_open ("{imap.gmail.com:993/imap/ssl}INBOX", "myemail@gmail.com", "mypassword")
     or die("can't connect: " . imap_last_error());
 
On my local server I get the following error:
2 - imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl}INBOX - /var/www/index.php:44
can't connect: Certificate failure for imap.gmail.com: unable to get local issuer certificate: /C=US/ST=California/L=Mountain View/O=Google Inc/CN=imap.gmail.com
However when I run this code on my shared server I get no errors and everything works hunk-dory... :|

I figured it was something to do with my router but what is it exactly? Anyone know? Am I missing something in the code? Is it because my computer maybe isn't configured to allow encrypted IMAP connections? How do I enable this if so?