Revert "改名"
This reverts commit fdf58326
This commit is contained in:
+26
-23
@@ -8,31 +8,34 @@ trait TSwooleClient
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
#[Pure] private function settings(): array
|
||||||
|
{
|
||||||
|
$sslCert = $this->getSslCertFile();
|
||||||
|
$sslKey = $this->getSslKeyFile();
|
||||||
|
$sslCa = $this->getCa();
|
||||||
|
|
||||||
/**
|
$params = [
|
||||||
* @return array
|
'open_eof_check' => true,
|
||||||
*/
|
'package_eof' => "\r\n\r\n",
|
||||||
#[Pure] private function settings(): array
|
'package_max_length' => 1024 * 1024 * 2,
|
||||||
{
|
];
|
||||||
$sslCert = $this->getSslCertFile();
|
if ($this->getConnectTimeout() > 0) {
|
||||||
$sslKey = $this->getSslKeyFile();
|
$params['timeout'] = $this->getConnectTimeout();
|
||||||
$sslCa = $this->getCa();
|
}
|
||||||
|
if (empty($sslCert) || empty($sslKey) || empty($sslCa)) {
|
||||||
|
return $params;
|
||||||
|
}
|
||||||
|
|
||||||
$params = [];
|
$params['ssl_host_name'] = $this->getHost();
|
||||||
if ($this->getConnectTimeout() > 0) {
|
$params['ssl_cert_file'] = $this->getSslCertFile();
|
||||||
$params['timeout'] = $this->getConnectTimeout();
|
$params['ssl_key_file'] = $this->getSslKeyFile();
|
||||||
}
|
$params['ssl_verify_peer'] = TRUE;
|
||||||
if (empty($sslCert) || empty($sslKey) || empty($sslCa)) {
|
$params['ssl_cafile'] = $sslCa;
|
||||||
return $params;
|
|
||||||
}
|
|
||||||
|
|
||||||
$params['ssl_host_name'] = $this->getHost();
|
return $params;
|
||||||
$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