From aae5f9cea3739423a4b0d64c89b476c8431a036c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 13 Aug 2020 10:56:00 +0800 Subject: [PATCH] add clear --- wchat/common/HttpClient.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wchat/common/HttpClient.php b/wchat/common/HttpClient.php index 275eaac..b924aef 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -664,11 +664,11 @@ class HttpClient if (!empty($this->agent)) { curl_setopt($ch, CURLOPT_USERAGENT, $this->agent); } - if ($this->getSslCertFile()) { - curl_setopt($ch, CURLOPT_SSLCERT, $this->getSslCertFile()); + if (file_exists($cert = $this->getSslCertFile())) { + curl_setopt($ch, CURLOPT_SSLCERT, $cert); } - if ($this->getSslKeyFile()) { - curl_setopt($ch, CURLOPT_SSLKEY, $this->getSslKeyFile()); + if (file_exists($key = $this->getSslKeyFile())) { + curl_setopt($ch, CURLOPT_SSLKEY, $key); } curl_setopt($ch, CURLOPT_NOBODY, FALSE); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1); // 超时设置