This commit is contained in:
老九 2021-11-13 23:35:17 +08:00
parent e913983bd5
commit 0ec47bc23a

View File

@ -49,7 +49,7 @@ namespace FastGithub.HttpServer
if (Environment.UserName != "root") if (Environment.UserName != "root")
{ {
this.logger.LogWarning($"无法自动安装证书{caCertFilePath}因为没有root权限"); this.logger.LogWarning($"无法自动安装CA证书{caCertFilePath}因为没有root权限");
return; return;
} }
@ -58,12 +58,12 @@ namespace FastGithub.HttpServer
Directory.CreateDirectory(this.CaCertStorePath); Directory.CreateDirectory(this.CaCertStorePath);
File.Copy(caCertFilePath, destCertFilePath, overwrite: true); File.Copy(caCertFilePath, destCertFilePath, overwrite: true);
Process.Start(this.CaCertUpdatePath).WaitForExit(); Process.Start(this.CaCertUpdatePath).WaitForExit();
this.logger.LogInformation($"已自动向系统安装证书{caCertFilePath}"); this.logger.LogInformation($"已自动向系统安装CA证书{caCertFilePath}");
} }
catch (Exception ex) catch (Exception ex)
{ {
File.Delete(destCertFilePath); File.Delete(destCertFilePath);
this.logger.LogWarning(ex.Message, "自动安装证书异常"); this.logger.LogWarning(ex.Message, "自动安装CA证书异常");
} }
} }
} }