From 551410926d942952ed63562232dae48d9ef6b47d Mon Sep 17 00:00:00 2001 From: huanglonghui Date: Mon, 12 Jul 2021 14:19:54 +0800 Subject: [PATCH] fix:can't support https --- src/Client.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index 3f74526..f9b1b3a 100644 --- a/src/Client.php +++ b/src/Client.php @@ -488,6 +488,10 @@ public function request(AbstractEndpoint $endpoint): Response $httpClient = new HttpClient($url); + if ($this->config->getScheme() === 'https') { + $httpClient->setEnableSSL(true); + } + if ($this->config->getUsername() && $this->config->getPassword()){ $httpClient->setHeader('authorization','Basic ' . base64_encode($this->config->getUsername().':'.$this->config->getPassword()), false); } @@ -517,4 +521,4 @@ public function request(AbstractEndpoint $endpoint): Response } return $response; } -} \ No newline at end of file +}