From caf2960d4ae7b890d7beb3d53bb6c4fca1f7db68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 22 May 2020 14:53:59 +0800 Subject: [PATCH] add clear --- wchat/common/HttpClient.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wchat/common/HttpClient.php b/wchat/common/HttpClient.php index c662113..da7513c 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -633,8 +633,12 @@ class HttpClient if (!empty($this->agent)) { curl_setopt($ch, CURLOPT_USERAGENT, $this->agent); } - - curl_setopt($ch, CURLOPT_SSLCERT, $this->getSslCertFile()); + if (!empty($this->getSslCertFile())) { + curl_setopt($ch, CURLOPT_SSLCERT, $this->getSslCertFile()); + } + if (!empty($this->getSslCertFile())) { + curl_setopt($ch, CURLOPT_SSLCERT, $this->getSslCertFile()); + } curl_setopt($ch, CURLOPT_SSLKEY, $this->getSslKeyFile()); curl_setopt($ch, CURLOPT_NOBODY, FALSE); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1); // 超时设置