Skip to content

Commit 9d499e4

Browse files
committed
Merge in 'release/6.0' changes
2 parents 7f3f912 + 5470a6c commit 9d499e4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Shared/CertificateGeneration/MacOSCertificateManager.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ internal class MacOSCertificateManager : CertificateManager
1919
private static readonly string MacOSUserKeyChain = Environment.GetEnvironmentVariable("HOME") + "/Library/Keychains/login.keychain-db";
2020
private const string MacOSSystemKeyChain = "/Library/Keychains/System.keychain";
2121
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 + "\"";
2323
private const string MacOSFindCertificateOutputRegex = "SHA-1 hash: ([0-9A-Z]+)";
2424
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}\"";
2626
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}\"";
2828
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 + "\" ";
3030

3131
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";
3333

3434
public const string InvalidCertificateState = "The ASP.NET Core developer certificate is in an invalid state. " +
3535
"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

Comments
 (0)