@@ -19,17 +19,17 @@ internal class MacOSCertificateManager : CertificateManager
19
19
private static readonly string MacOSUserKeyChain = Environment . GetEnvironmentVariable ( "HOME" ) + "/Library/Keychains/login.keychain-db" ;
20
20
private const string MacOSSystemKeyChain = "/Library/Keychains/System.keychain" ;
21
21
private const string MacOSFindCertificateCommandLine = "security" ;
22
- private const string MacOSFindCertificateCommandLineArgumentsFormat = "find-certificate -c {0} -a -Z -p " + MacOSSystemKeyChain ;
22
+ private const string MacOSFindCertificateCommandLineArgumentsFormat = "find-certificate -c {0} -a -Z -p \" " + MacOSSystemKeyChain + " \" " ;
23
23
private const string MacOSFindCertificateOutputRegex = "SHA-1 hash: ([0-9A-Z]+)" ;
24
24
private const string MacOSRemoveCertificateTrustCommandLine = "sudo" ;
25
- private const string MacOSRemoveCertificateTrustCommandLineArgumentsFormat = "security remove-trusted-cert -d {0}" ;
25
+ private const string MacOSRemoveCertificateTrustCommandLineArgumentsFormat = "security remove-trusted-cert -d \" {0}\" " ;
26
26
private const string MacOSDeleteCertificateCommandLine = "sudo" ;
27
- private const string MacOSDeleteCertificateCommandLineArgumentsFormat = "security delete-certificate -Z {0} {1}" ;
27
+ private const string MacOSDeleteCertificateCommandLineArgumentsFormat = "security delete-certificate -Z {0} \" {1}\" " ;
28
28
private const string MacOSTrustCertificateCommandLine = "sudo" ;
29
- private const string MacOSTrustCertificateCommandLineArguments = "security add-trusted-cert -d -r trustRoot -k " + MacOSSystemKeyChain + " " ;
29
+ private const string MacOSTrustCertificateCommandLineArguments = "security add-trusted-cert -d -r trustRoot -k \" " + MacOSSystemKeyChain + " \ " ";
30
30
31
31
private const string MacOSAddCertificateToKeyChainCommandLine = "security" ;
32
- private static readonly string MacOSAddCertificateToKeyChainCommandLineArgumentsFormat = "import {0} -k " + MacOSUserKeyChain + " -t cert -f pkcs12 -P {1} -A" ;
32
+ private static readonly string MacOSAddCertificateToKeyChainCommandLineArgumentsFormat = "import \" {0}\" -k \" " + MacOSUserKeyChain + " \ " -t cert -f pkcs12 -P {1} -A";
33
33
34
34
public const string InvalidCertificateState = "The ASP.NET Core developer certificate is in an invalid state. " +
35
35
"To fix this issue, run the following commands 'dotnet dev-certs https --clean' and 'dotnet dev-certs https' to remove all existing ASP.NET Core development certificates " +
0 commit comments