- 修复保存远程文件ssl协议问题

v6
Chaim 4 years ago
parent e0c6352201
commit 7ac22c113e

@ -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));
}
/**

Loading…
Cancel
Save