1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 16:10:08 +01:00

throw exception if trust CA is canceled

This commit is contained in:
Austin Drummond
2024-06-21 13:14:32 -04:00
parent 35b32b6047
commit 72845a36f7

View File

@@ -640,9 +640,14 @@ public function createSigningRequest(string $url, string $keyPath, string $csrPa
*/
public function trustCa(string $caPemPath): void
{
$this->cli->run(sprintf(
'sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain "%s"', $caPemPath
info('Trusting Laravel Valet Certificate Authority...');
$result = $this->cli->run(sprintf(
'sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain "%s"',
$caPemPath
));
if ($result) {
throw new DomainException('The Certificate Authority must be trusted. Please run the command again.');
}
}
/**