From PHP 5.6, SSL/TLS client streams now enable peer verification by default.
So, error occurs when communicate with the server that is using a self-signed certificate.
See: http://php.net/manual/migration56.openssl.php
In order to avoid the above problem:
$options = [
'ssl' => [
'verify_peer_name' => false,
'verify_peer' => false,
]
];
$context = stream_context_create($options);
// ex. https://github.com/zendframework/zend-mail/blob/release-2.7.0/src/Protocol/Pop3.php#L95
// $this->socketfsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION);
$this->socketfsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION, $context);
In this way, there is a need to pass a stream context to the stream function.
However, the current Zend\Mail\Protocol\Pop3 and Zend\Mail\Protocol\Smtp look like does not provide an interface to pass stream context.
Is there support for the above interface in future?
A similar way: zend-http/zend.http.client.adapters.md at release-2.5.4 · zendframework/zend-http
Originally posted by @gongo at zendframework/zend-mail#84
From PHP 5.6, SSL/TLS client streams now enable peer verification by default.
So, error occurs when communicate with the server that is using a self-signed certificate.
See: http://php.net/manual/migration56.openssl.php
In order to avoid the above problem:
In this way, there is a need to pass a stream context to the stream function.
However, the current
Zend\Mail\Protocol\Pop3andZend\Mail\Protocol\Smtplook like does not provide an interface to pass stream context.Is there support for the above interface in future?
A similar way: zend-http/zend.http.client.adapters.md at release-2.5.4 · zendframework/zend-http
Originally posted by @gongo at zendframework/zend-mail#84