我正在尝试通过php脚本连接到ssl:// imap fsockopen()
服务器:CentOS Linux版本7.1.1503
Apache:Apache/2.4.6
PHP:PHP 5.6.17
$host = "ssl://mail.example.com";
$port = 993;
echo "Connecting with " . $host . "o port " . $port;
$socket = fsockopen($host, $port, $errno, $errstr, 30);
if (!$socket) {
echo "Connection failed";
}
$line = fgets($socket);
return $line;
Run Code Online (Sandbox Code Playgroud)
收到此错误:
Connecting with ssl://mail.example.com port 993PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in imapProtocols/imap.php on line 7
Warning: fsockopen(): SSL operation failed with code 1. OpenSSL …Run Code Online (Sandbox Code Playgroud)