Skip to content

Commit c79bc98

Browse files
committed
only trust the CA, not the individual cert
1 parent 42f4f39 commit c79bc98

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cli/Valet/Site.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,14 @@ public function createCa(int $caExpireInDays): void
526526
$caKeyPath = $this->caPath('LaravelValetCASelfSigned.key');
527527

528528
if ($this->files->exists($caKeyPath) && $this->files->exists($caPemPath)) {
529+
530+
$isTrusted = $this->cli->run(sprintf(
531+
'security verify-cert -c "%s"', $caPemPath
532+
));
533+
534+
if (strpos($isTrusted, '...certificate verification successful.') === false) {
535+
$this->trustCa($caPemPath);
536+
}
529537
return;
530538
}
531539

@@ -608,8 +616,6 @@ public function createCertificate(string $url, int $caExpireInDays): void
608616
$caExpireInDays, $caPemPath, $caKeyPath, $caSrlParam, $csrPath, $crtPath, $confPath
609617
));
610618
}
611-
612-
$this->trustCertificate($crtPath);
613619
}
614620

615621
/**

0 commit comments

Comments
 (0)