Skip to content

Commit

Permalink
移除多余的条件判断
Browse files Browse the repository at this point in the history
  • Loading branch information
livelyRyan authored Jul 30, 2020
1 parent 5203804 commit 7831638
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7831638

Please sign in to comment.