diff --git a/src/guanyierp.php b/src/guanyierp.php index 4fbc88e..4e092e9 100644 --- a/src/guanyierp.php +++ b/src/guanyierp.php @@ -321,6 +321,10 @@ public function url($method, $url, $data = [], $extopt = [], $timeout = null) curl_setopt($ch, CURLOPT_HTTPHEADER, $extopt['header']); } + if ($scheme == 'https') { //忽略证书部分 + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); + } $content = curl_exec($ch); curl_close($ch); return $content; diff --git a/src/guanyiweb.php b/src/guanyiweb.php index b43e262..bc1ab0b 100644 --- a/src/guanyiweb.php +++ b/src/guanyiweb.php @@ -233,6 +233,10 @@ public function url($method, $url, $data = [], $extopt = [], $timeout = null) curl_setopt($ch, CURLOPT_HTTPHEADER, $extopt['header']); } + if ($scheme == 'https') { //忽略证书部分 + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); + } $content = curl_exec($ch); curl_close($ch); return $content;