Skip to content

Commit

Permalink
Merge pull request #39 from acoshift/fix/config-cert
Browse files Browse the repository at this point in the history
config: only load cert, key when exists
  • Loading branch information
acoshift committed Jul 20, 2018
2 parents f3d80b3 + 5901d34 commit 1fe0b34
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@ func (app *App) Config(config AppConfig) *App {
parseDuration(config.Server.ReadHeaderTimeout, &app.ReadHeaderTimeout)
parseDuration(config.Server.WriteTimeout, &app.WriteTimeout)
parseDuration(config.Server.IdleTimeout, &app.IdleTimeout)
app.certFile = config.Server.CertFile
app.keyFile = config.Server.KeyFile

if config.Server.CertFile != "" {
app.certFile = config.Server.CertFile
}
if config.Server.KeyFile != "" {
app.keyFile = config.Server.KeyFile
}

// load graceful config
if config.Server.GracefulShutdown != nil {
Expand Down

0 comments on commit 1fe0b34

Please sign in to comment.