From 7ac22c113efce6df4bfd681b805b21b0fac271d9 Mon Sep 17 00:00:00 2001 From: Chaim Date: Sun, 7 Jun 2020 17:54:58 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8D=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E6=96=87=E4=BB=B6ssl=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/StorageService.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/service/StorageService.php b/src/service/StorageService.php index edd147b..0b9679a 100644 --- a/src/service/StorageService.php +++ b/src/service/StorageService.php @@ -70,13 +70,8 @@ class StorageService extends Service if (empty($this->path)) $this->getConfig(); // 判断是否存在 is_dir($this->path) or mkdir($this->path, 0777, true); - $arrContextOptions = [ - 'ssl' => [ - 'verify_peer' => false, - 'verify_peer_name' => false, - ] - ]; - return file_put_contents("{$this->path}{$name}", file_get_contents($this->remotely, false, stream_context_create($arrContextOptions))); + if (strpos($this->remotely, 'https')) $this->remotely = str_replace("https", "http", $this->remotely); + return file_put_contents("{$this->path}{$name}", file_get_contents($this->remotely)); } /**