From f2421b71e7ced4025a99b2ede5c8a2a8cbc9e31b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 18 Aug 2023 16:36:05 +0800 Subject: [PATCH] qqq --- TSwooleClient.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/TSwooleClient.php b/TSwooleClient.php index 2bb6cdc..5ffb5a4 100644 --- a/TSwooleClient.php +++ b/TSwooleClient.php @@ -19,16 +19,16 @@ trait TSwooleClient if ($this->getConnectTimeout() > 0) { $params['timeout'] = $this->getConnectTimeout(); } - $params['ssl_host_name'] = $this->getHost(); - if (!empty($sslCert)) { - $params['ssl_cert_file'] = $this->getSslCertFile(); - } - if (!empty($sslKey)) { - $params['ssl_key_file'] = $this->getSslKeyFile(); - } - if (!empty($sslCa)) { - $params['ssl_cafile'] = $sslCa; - } + 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; }