mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
Merge pull request #6775 from rxu/ticket/17467
[ticket/17467] Provide TLS v.1.3 support for SMTP connections
This commit is contained in:
commit
bf29596bad
1 changed files with 3 additions and 5 deletions
|
@ -1615,12 +1615,10 @@ class smtp_class
|
|||
$result = false;
|
||||
$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
|
||||
$crypto = (phpbb_version_compare(PHP_VERSION, '5.6.7', '<')) ? STREAM_CRYPTO_METHOD_TLS_CLIENT : STREAM_CRYPTO_METHOD_SSLv23_CLIENT;
|
||||
$result = stream_socket_enable_crypto($this->socket, true, $crypto);
|
||||
socket_set_blocking($this->socket, (int) $stream_meta['blocked']);
|
||||
$result = stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
|
||||
stream_set_blocking($this->socket, (int) $stream_meta['blocked']);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
|
Loading…
Add table
Reference in a new issue