Skip to content

Commit

Permalink
Merge pull request #1463 from adrum/feature/trust-ca-cert
Browse files Browse the repository at this point in the history
Trust CA Certificate only
  • Loading branch information
mattstauffer authored May 31, 2024
2 parents b62bc68 + c0a2c7e commit 2da59f9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cli/Valet/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,14 @@ public function createCa(int $caExpireInDays): void
$caKeyPath = $this->caPath('LaravelValetCASelfSigned.key');

if ($this->files->exists($caKeyPath) && $this->files->exists($caPemPath)) {

$isTrusted = $this->cli->run(sprintf(
'security verify-cert -c "%s"', $caPemPath
));

if (strpos($isTrusted, '...certificate verification successful.') === false) {
$this->trustCa($caPemPath);
}
return;
}

Expand Down Expand Up @@ -607,8 +615,6 @@ public function createCertificate(string $url, int $caExpireInDays): void
$caExpireInDays, $caPemPath, $caKeyPath, $caSrlParam, $csrPath, $crtPath, $confPath
));
}

$this->trustCertificate($crtPath);
}

/**
Expand Down

0 comments on commit 2da59f9

Please sign in to comment.