From 1b5232f5e77086603c2c60767d74639d24064298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 18 Aug 2023 15:43:52 +0800 Subject: [PATCH] qqq --- TSwooleClient.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/TSwooleClient.php b/TSwooleClient.php index 5ffb5a4..2bb6cdc 100644 --- a/TSwooleClient.php +++ b/TSwooleClient.php @@ -19,16 +19,16 @@ trait TSwooleClient 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; - + $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; + } return $params; }