mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 08:30:07 +01:00
Merge pull request #1463 from adrum/feature/trust-ca-cert
Trust CA Certificate only
This commit is contained in:
@@ -525,6 +525,14 @@ public function createCa(int $caExpireInDays): void
|
|||||||
$caKeyPath = $this->caPath('LaravelValetCASelfSigned.key');
|
$caKeyPath = $this->caPath('LaravelValetCASelfSigned.key');
|
||||||
|
|
||||||
if ($this->files->exists($caKeyPath) && $this->files->exists($caPemPath)) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -607,8 +615,6 @@ public function createCertificate(string $url, int $caExpireInDays): void
|
|||||||
$caExpireInDays, $caPemPath, $caKeyPath, $caSrlParam, $csrPath, $crtPath, $confPath
|
$caExpireInDays, $caPemPath, $caKeyPath, $caSrlParam, $csrPath, $crtPath, $confPath
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->trustCertificate($crtPath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user