Skip to content

Commit

Permalink
Merge pull request #25 from IndrekHaav/cert_subdir_fix
Browse files Browse the repository at this point in the history
Skip non-files when loading certificates
  • Loading branch information
rasmuskukk authored Apr 6, 2023
2 parents 3fc1fbe + 13c3c90 commit d1402b8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/AuthenticationResponseValidatorBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function getTrustedCaCertificates()
public function withTrustedCaCertificatesFolder(string $trustedCertsPath) : AuthenticationResponseValidatorBuilder
{
foreach (array_diff(scandir($trustedCertsPath), array('.', '..')) as $file) {
if (!is_file($trustedCertsPath.$file)) continue;
$caCertificate = file_get_contents($trustedCertsPath.$file);
$caCert = Certificate::fromPEM(PEM::fromString($caCertificate));
$this->trustedCaCertificates[] = $caCert;
Expand Down

0 comments on commit d1402b8

Please sign in to comment.