From 6891fc06bd255c3e6624343cb01f234782b1d997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E4=BC=9F?= <366193849@qq.com> Date: Tue, 27 Jul 2021 17:32:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub/Controllers/CertController.cs | 23 +++++++++++++++++++++ FastGithub/Views/Home/Index.cshtml | 26 +++++++++++++++--------- 2 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 FastGithub/Controllers/CertController.cs diff --git a/FastGithub/Controllers/CertController.cs b/FastGithub/Controllers/CertController.cs new file mode 100644 index 0000000..86be236 --- /dev/null +++ b/FastGithub/Controllers/CertController.cs @@ -0,0 +1,23 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Threading.Tasks; + +namespace FastGithub.Controllers +{ + public class CertController : Controller + { + /// + /// 下载CA证书 + /// + /// + public async Task Index() + { + var certFile = $"CACert/{nameof(FastGithub)}.cer"; + this.Response.ContentType = "application/x-x509-ca-cert"; + this.Response.Headers.Add("Content-Disposition", $"attachment;filename={nameof(FastGithub)}.cer"); + await this.Response.SendFileAsync(certFile); + return new EmptyResult(); + } + } +} diff --git a/FastGithub/Views/Home/Index.cshtml b/FastGithub/Views/Home/Index.cshtml index b307f77..fe529e2 100644 --- a/FastGithub/Views/Home/Index.cshtml +++ b/FastGithub/Views/Home/Index.cshtml @@ -28,10 +28,11 @@

FastGithub

github加速神器

+ https://github.com/xljiulang/FastGithub

CA证书

- 你可能需要下载FastGithub自颁发的CA证书,根据设备所使用的平台要求,导入到受信任的受信任的根证书颁发机构或浏览器 + 你可能需要下载FastGithub自颁发的CA证书,根据设备所使用的平台要求,导入到受信任的根证书颁发机构或浏览器

运行方式

@@ -77,19 +78,24 @@
-
git ssl验证
+
git
-

- git pull或push时会遇到SSL certificate problem: unable to get local issuer certificate -

-

- 需要关闭git的证书验证: - git config --global http.sslverify false -

+

SSL certificate problem

+

需要关闭git的证书验证:

+

git config --global http.sslverify false

+
+
+
+
+
+
firefox
+
+

未连接:有潜在的安全问题

+

设置->隐私与安全->证书->查看证书

+

证书管理器->证书颁发机构->导入FastGithub.cer

-