mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/17467] Provide TLS v.1.3 support for SMTP connections
PHPBB-17467
This commit is contained in:
parent
2f08d8eb72
commit
a86f368f3d
1 changed files with 3 additions and 5 deletions
|
@ -1615,12 +1615,10 @@ class smtp_class
|
||||||
$result = false;
|
$result = false;
|
||||||
$stream_meta = stream_get_meta_data($this->socket);
|
$stream_meta = stream_get_meta_data($this->socket);
|
||||||
|
|
||||||
if (socket_set_blocking($this->socket, 1))
|
if (stream_set_blocking($this->socket, 1))
|
||||||
{
|
{
|
||||||
// https://secure.php.net/manual/en/function.stream-socket-enable-crypto.php#119122
|
$result = stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
|
||||||
$crypto = (phpbb_version_compare(PHP_VERSION, '5.6.7', '<')) ? STREAM_CRYPTO_METHOD_TLS_CLIENT : STREAM_CRYPTO_METHOD_SSLv23_CLIENT;
|
stream_set_blocking($this->socket, (int) $stream_meta['blocked']);
|
||||||
$result = stream_socket_enable_crypto($this->socket, true, $crypto);
|
|
||||||
socket_set_blocking($this->socket, (int) $stream_meta['blocked']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|
Loading…
Add table
Reference in a new issue