mirror of
https://github.com/astaxie/beego.git
synced 2025-07-20 11:35:30 +00:00
简化代码写法
This commit is contained in:
3
app.go
3
app.go
@@ -197,11 +197,10 @@ func (app *App) Run(mws ...MiddleWare) {
|
|||||||
pool.AppendCertsFromPEM(data)
|
pool.AppendCertsFromPEM(data)
|
||||||
tlsConfig := tls.Config{
|
tlsConfig := tls.Config{
|
||||||
ClientCAs: pool,
|
ClientCAs: pool,
|
||||||
|
ClientAuth: tls.RequireAndVerifyClientCert,
|
||||||
}
|
}
|
||||||
if string(BConfig.Listen.ClientAuth) != "" {
|
if string(BConfig.Listen.ClientAuth) != "" {
|
||||||
tslConfig.ClientAuth = BConfig.Listen.ClientAuth
|
tslConfig.ClientAuth = BConfig.Listen.ClientAuth
|
||||||
} else {
|
|
||||||
tslConfig.ClientAuth = tls.RequireAndVerifyClientCert
|
|
||||||
}
|
}
|
||||||
app.Server.TLSConfig = &tslConfig
|
app.Server.TLSConfig = &tslConfig
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user