1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-24 23:50:55 +00:00

移除多余的条件判断

This commit is contained in:
Mr. Myy 2020-07-30 14:48:46 +08:00 committed by GitHub
parent 5203804165
commit 7831638f37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

8
app.go
View File

@ -195,14 +195,10 @@ func (app *App) Run(mws ...MiddleWare) {
return
}
pool.AppendCertsFromPEM(data)
tlsConfig := tls.Config{
app.Server.TLSConfig = &tls.Config{
ClientCAs: pool,
ClientAuth: tls.RequireAndVerifyClientCert,
ClientAuth: BConfig.Listen.ClientAuth,
}
if string(BConfig.Listen.ClientAuth) != "" {
tlsConfig.ClientAuth = BConfig.Listen.ClientAuth
}
app.Server.TLSConfig = &tlsConfig
}
if err := app.Server.ListenAndServeTLS(BConfig.Listen.HTTPSCertFile, BConfig.Listen.HTTPSKeyFile); err != nil {
logs.Critical("ListenAndServeTLS: ", err)