From 513a4afff14c056f1fe5a844d8a60123987491f3 Mon Sep 17 00:00:00 2001 From: "Mr. Myy" <1135038815@qq.com> Date: Thu, 30 Jul 2020 10:59:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=20Listen=20=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=BD=93=E5=A2=9E=E5=8A=A0=20ClientAuth=20=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 对 Listen 结构体增加 ClientAuth 字段,赋予默认配置对象该字段值为 tls.VerifyClientCertIfGiven,与原代码逻辑的默认值保持一致 --- config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config.go b/config.go index 92aa3bbd..fef6c482 100644 --- a/config.go +++ b/config.go @@ -21,6 +21,7 @@ import ( "reflect" "runtime" "strings" + "crypto/tls" "github.com/astaxie/beego/config" "github.com/astaxie/beego/context" @@ -65,6 +66,7 @@ type Listen struct { HTTPSCertFile string HTTPSKeyFile string TrustCaFile string + ClientAuth tls.ClientAuthType EnableAdmin bool AdminAddr string AdminPort int @@ -234,6 +236,7 @@ func newBConfig() *Config { AdminPort: 8088, EnableFcgi: false, EnableStdIo: false, + ClientAuth: tls.VerifyClientCertIfGiven, }, WebConfig: WebConfig{ AutoRender: true,