From 5cf4aea612547e7f0553788e61935b7d2c9b15db Mon Sep 17 00:00:00 2001 From: David Connolly Date: Tue, 3 Dec 2019 22:47:12 +0000 Subject: [PATCH] Cater for filepaths with spaces Fixes issue where certificates fail to be generated due to a space in the filepath --- cli/Valet/Site.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/Valet/Site.php b/cli/Valet/Site.php index 0c3f83153..6827dd5b1 100644 --- a/cli/Valet/Site.php +++ b/cli/Valet/Site.php @@ -365,7 +365,7 @@ function createCertificate($url) $this->createPrivateKey($keyPath); $this->createSigningRequest($url, $keyPath, $csrPath, $confPath); - $caSrlParam = '-CAserial ' . $caSrlPath; + $caSrlParam = '-CAserial "' . $caSrlPath . '"'; if (! $this->files->exists($caSrlPath)) { $caSrlParam .= ' -CAcreateserial'; } @@ -420,7 +420,7 @@ function createSigningRequest($url, $keyPath, $csrPath, $confPath) function trustCa($caPemPath) { $this->cli->run(sprintf( - 'sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain %s', $caPemPath + 'sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain "%s"', $caPemPath )); } @@ -433,7 +433,7 @@ function trustCa($caPemPath) function trustCertificate($crtPath) { $this->cli->run(sprintf( - 'sudo security add-trusted-cert -d -r trustAsRoot -k /Library/Keychains/System.keychain %s', $crtPath + 'sudo security add-trusted-cert -d -r trustAsRoot -k /Library/Keychains/System.keychain "%s"', $crtPath )); }