Skip to content

Commit

Permalink
Merge pull request #76 from silinternational/develop
Browse files Browse the repository at this point in the history
Release 4.3.1 - log a more accurate error message for DNS failure
  • Loading branch information
briskt authored Jun 19, 2023
2 parents 221697d + 07ac8df commit c05d01c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/IdBrokerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -717,9 +717,13 @@ public function updateUser(array $config = [ ]): array
private function assertTrustedBrokerIp()
{
$baseHost = parse_url($this->idBrokerUri, PHP_URL_HOST);
$idBrokerIp = gethostbyname(
$baseHost
);
$idBrokerIp = gethostbyname($baseHost);
if ($idBrokerIp == $baseHost) {
throw new Exception(
'DNS lookup failure on broker host ' . $baseHost,
1687147214
);
}

if (! $this->isTrustedIpAddress($idBrokerIp)) {
throw new Exception(
Expand Down

0 comments on commit c05d01c

Please sign in to comment.