Skip to content

Commit

Permalink
[Bug fix] Ignoring ssl integrity check for assets files (#66)
Browse files Browse the repository at this point in the history
* Ignoring ssl integrity check for assets files

* ignore ssl certificate integrity check on get remote file size function
  • Loading branch information
MuriloChianfa authored Sep 4, 2024
1 parent efc6447 commit c90da10
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c90da10

Please sign in to comment.