From c90da109428180ab397fc2b9e3f10c8a3b51c921 Mon Sep 17 00:00:00 2001 From: MuriloChianfa <60560085+MuriloChianfa@users.noreply.github.com> Date: Wed, 4 Sep 2024 03:48:18 -0300 Subject: [PATCH] [Bug fix] Ignoring ssl integrity check for assets files (#66) * Ignoring ssl integrity check for assets files * ignore ssl certificate integrity check on get remote file size function --- src/helpers.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/helpers.php b/src/helpers.php index 97b5389..0b35c40 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -71,7 +71,12 @@ function getRemoteFileSize(string $url): int } if (! isset($contentLength)) { - $contentLength = strlen(file_get_contents($url)); + $options = (array) config('seo.http.options', []); + $context = isset($options['verify']) && !$options['verify'] + ? $context = ['ssl' => ['verify_peer' => false, 'verify_peer_name' => false]] + : []; + + $contentLength = strlen(file_get_contents($url, false, stream_context_create($context))); } return $contentLength;