e
This commit is contained in:
+37
-37
@@ -1,38 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Http\Client;
|
||||
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
|
||||
trait TSwooleClient
|
||||
{
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
#[Pure] private function settings(): array
|
||||
{
|
||||
$sslCert = $this->getSslCertFile();
|
||||
$sslKey = $this->getSslKeyFile();
|
||||
$sslCa = $this->getCa();
|
||||
|
||||
$params = [];
|
||||
if ($this->getConnectTimeout() > 0) {
|
||||
$params['timeout'] = $this->getConnectTimeout();
|
||||
}
|
||||
if (empty($sslCert) || empty($sslKey) || empty($sslCa)) {
|
||||
return $params;
|
||||
}
|
||||
|
||||
$params['ssl_host_name'] = $this->getHost();
|
||||
$params['ssl_cert_file'] = $this->getSslCertFile();
|
||||
$params['ssl_key_file'] = $this->getSslKeyFile();
|
||||
$params['ssl_verify_peer'] = TRUE;
|
||||
$params['ssl_cafile'] = $sslCa;
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
namespace Http\Client;
|
||||
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
|
||||
trait TSwooleClient
|
||||
{
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
#[Pure] private function settings(): array
|
||||
{
|
||||
$sslCert = $this->getSslCertFile();
|
||||
$sslKey = $this->getSslKeyFile();
|
||||
$sslCa = $this->getCa();
|
||||
|
||||
$params = [];
|
||||
if ($this->getConnectTimeout() > 0) {
|
||||
$params['timeout'] = $this->getConnectTimeout();
|
||||
}
|
||||
if (empty($sslCert) || empty($sslKey) || empty($sslCa)) {
|
||||
return $params;
|
||||
}
|
||||
|
||||
$params['ssl_host_name'] = $this->getHost();
|
||||
$params['ssl_cert_file'] = $this->getSslCertFile();
|
||||
$params['ssl_key_file'] = $this->getSslKeyFile();
|
||||
$params['ssl_verify_peer'] = TRUE;
|
||||
$params['ssl_cafile'] = $sslCa;
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user