Small fixes

This commit is contained in:
RainLoop Team 2019-03-29 23:42:49 +03:00
parent e77bafca1e
commit 18242368be
29 changed files with 16 additions and 35724 deletions

View file

@ -196,7 +196,7 @@ abstract class NetClient
* @param int $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT
* @param bool $bVerifySsl = false
* @param bool $bAllowSelfSigned = true
* @param string $sClientCert = NULL
* @param string $sClientCert = ''
*
* @return void
*
@ -261,11 +261,15 @@ abstract class NetClient
'verify_host' => $bVerifySsl,
'verify_peer' => $bVerifySsl,
'verify_peer_name' => $bVerifySsl,
'allow_self_signed' => $bAllowSelfSigned,
'local_cert' => $sClientCert
'allow_self_signed' => $bAllowSelfSigned
)
);
if (!empty($sClientCert))
{
$aStreamContextSettings['ssl']['local_cert'] = $sClientCert;
}
\MailSo\Hooks::Run('Net.NetClient.StreamContextSettings/Filter', array(&$aStreamContextSettings));
$rStreamContext = \stream_context_create($aStreamContextSettings);
@ -319,8 +323,10 @@ abstract class NetClient
{
case defined('STREAM_CRYPTO_METHOD_ANY_CLIENT') &&
@\stream_socket_enable_crypto($this->rConnect, true, STREAM_CRYPTO_METHOD_ANY_CLIENT):
case @\stream_socket_enable_crypto($this->rConnect, true, STREAM_CRYPTO_METHOD_TLS_CLIENT):
case @\stream_socket_enable_crypto($this->rConnect, true, STREAM_CRYPTO_METHOD_SSLv23_CLIENT):
case defined('STREAM_CRYPTO_METHOD_TLS_CLIENT') &&
@\stream_socket_enable_crypto($this->rConnect, true, STREAM_CRYPTO_METHOD_TLS_CLIENT):
case defined('STREAM_CRYPTO_METHOD_SSLv23_CLIENT') &&
@\stream_socket_enable_crypto($this->rConnect, true, STREAM_CRYPTO_METHOD_SSLv23_CLIENT):
$bError = false;
break;
}