| Conditions | 2 | 
| Paths | 2 | 
| Total Lines | 14 | 
| Code Lines | 11 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); | ||
| 26 | public function check(string $hostname, string $expectedIp) | ||
| 27 |     { | ||
| 28 | $ip = gethostbyname($hostname); | ||
| 29 |         if ($ip === $expectedIp) { | ||
| 30 | $this->processRunner->mustRun(Process::fromShellCommandline( | ||
| 31 |                 'if [ "${ACME_ENABLED:-true}" = true ]; then '. | ||
| 32 | "check-certificate $hostname 6; ". | ||
| 33 | 'else echo "Skipping SSL verification"; fi' | ||
| 34 | )); | ||
| 35 |         } else { | ||
| 36 |             $this->style->note("Skipping SSL verification because $hostname resolves to {$ip} ". | ||
| 37 | "instead of machine ip which is $expectedIp\n". | ||
| 38 | "You should wait for DNS to update or force $hostname to $expectedIp ". | ||
| 39 | "in your /etc/hosts file."); | ||
| 40 | } | ||
| 43 |