From e9c21d404a55ff162caf4606251c14b769a84377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 31 Mar 2020 15:06:15 +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 9ab1c4c..4c31087 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -337,7 +337,6 @@ class HttpClient */ private function coroutine($ip, $url, $data = []) { - echo $ip . ':' . $url . PHP_EOL; $client = $this->generate_client($ip, $url, $data); if ($client->statusCode < 0) { throw new \Exception($client->errMsg); @@ -391,7 +390,12 @@ class HttpClient private function generate_client($host, $url, $data) { $client = new SClient($host, $this->getHostPort(), $this->isSSL); - var_dump($host, $this->getHostPort()); + if (!empty($this->ssl_cert_file) && !empty($this->ssl_key_file)) { + $client->set([ + 'ssl_cert_file' => $this->ssl_cert_file, + 'ssl_key_file' => $this->ssl_key_file, + ]); + } if (!empty($this->agent)) { $this->header['User-Agent'] = $this->agent; }