diff options
author | Rodrigo Moya <rodrigo.moya@xamarin.com> | 2019-12-27 14:24:18 +0300 |
---|---|---|
committer | Rodrigo Moya <rodrigo.moya@xamarin.com> | 2020-01-23 19:47:49 +0300 |
commit | 1f344c5a852acd66525665b2faad391b50d9a272 (patch) | |
tree | c636f35f657c34c50e07ade9d30085fc291601c3 | |
parent | b6246867e382026f5b17cc3658b2dfdb51916eac (diff) |
[AspNetCore] Support new error code for dev-certs --checkpr-support-dotnet-broken-certs
Due to the issue we found with 3.1 Preview2 on notarization, the .NET Core
team have added a new error code to detect that situation, so VSMac needs
to take it into account and run "dev-certs https --trust" as with other
known error codes, which should fix the issue.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1032644
2 files changed, 13 insertions, 4 deletions
diff --git a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.DevCertInstaller/Program.cs b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.DevCertInstaller/Program.cs index 7d841e0c2a..f4bd97ce7b 100644 --- a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.DevCertInstaller/Program.cs +++ b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.DevCertInstaller/Program.cs @@ -122,6 +122,14 @@ namespace MonoDevelop.AspNetCore.DevCertInstaller } } + static int RunDevCertsCommand (string dotNetCorePath, string command) + { + using (var process = Process.Start (dotNetCorePath, $"dev-certs https {command}")) { + process.WaitForExit (); + return process.ExitCode; + } + } + static int RunDotNetDevCerts (string dotNetCorePath) { int result = Syscall.setuid (0); @@ -130,10 +138,10 @@ namespace MonoDevelop.AspNetCore.DevCertInstaller return -3; } - using (var process = Process.Start (dotNetCorePath, "dev-certs https --trust")) { - process.WaitForExit (); - return process.ExitCode; - } + // Clean the certificates to avoid issues with invalid ones + RunDevCertsCommand (dotNetCorePath, "--clean"); + + return RunDevCertsCommand (dotNetCorePath, "--trust"); } } } diff --git a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore/CertificateCheckResult.cs b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore/CertificateCheckResult.cs index e990db3079..6e2e795d2e 100644 --- a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore/CertificateCheckResult.cs +++ b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore/CertificateCheckResult.cs @@ -31,6 +31,7 @@ namespace MonoDevelop.AspNetCore OK = 0, Missing = 6, Untrusted = 7, + CertificateBroken = 9, Error = -1 } } |