Warning: imap_open(): Couldn't open stream error



Hi all,


I'm trying to setup a PHP/courier/MySQL webmail and it seems I can't
connect to imap.


$mailbox = imap_open("{localhost:143}", "username", "password") or
die("can't connect: " . imap_last_error());


returns :


Warning: imap_open(): Couldn't open stream {localhost:143}INBOX in
/var/www/html/webmail/index.php on line 4
can't connect: Certificate failure for localhost: self signed
certificate: /C=US/ST=NY/L=New York/O=Courier Mail
Server/OU=Automatically-generated IMAP SSL
key/CN=localhost/emailAddress=postmas...@xxxxxxxxxxx


Here's my maillog :


Jan 19 19:24:48 server imapd: Connection, ip=[::ffff:127.0.0.1]
Jan 19 19:24:48 server imapd: couriertls: connect: error:14094418:SSL
routines:SSL3_READ_BYTES:tlsv1 alert unknown ca
Jan 19 19:24:48 server imapd: Disconnected, ip=[::ffff:127.0.0.1],
time=0, starttls=1


How could I solve this problem ? any help would be much appreciated.

Thanks,


cedric

.