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); // 超时设置