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:
@@ -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.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user