简化代码写法

This commit is contained in:
Mr. Myy 2020-07-30 11:03:32 +08:00 committed by GitHub
parent 513a4afff1
commit 9d23e5a3fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

3
app.go
View File

@ -197,11 +197,10 @@ func (app *App) Run(mws ...MiddleWare) {
pool.AppendCertsFromPEM(data)
tlsConfig := tls.Config{
ClientCAs: pool,
ClientAuth: tls.RequireAndVerifyClientCert,
}
if string(BConfig.Listen.ClientAuth) != "" {
tslConfig.ClientAuth = BConfig.Listen.ClientAuth
} else {
tslConfig.ClientAuth = tls.RequireAndVerifyClientCert
}
app.Server.TLSConfig = &tslConfig
}