forked from TrueCloudLab/frostfs-s3-gw
[#716] Fix start TLS server
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
3a7ed8220e
commit
a18db163f2
1 changed files with 4 additions and 8 deletions
|
@ -418,18 +418,14 @@ func (a *App) Serve(ctx context.Context) {
|
|||
a.log.Fatal("failed to update cert", zap.Error(err))
|
||||
}
|
||||
|
||||
lnTLS := tls.NewListener(ln, &tls.Config{
|
||||
ln = tls.NewListener(ln, &tls.Config{
|
||||
GetCertificate: a.tlsProvider.GetCertificate,
|
||||
})
|
||||
|
||||
if err = srv.ServeTLS(lnTLS, certFile, keyFile); err != nil && err != http.ErrServerClosed {
|
||||
a.log.Fatal("listen and serve", zap.Error(err))
|
||||
}
|
||||
} else {
|
||||
|
||||
if err = srv.Serve(ln); err != nil && err != http.ErrServerClosed {
|
||||
a.log.Fatal("listen and serve", zap.Error(err))
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
sigs := make(chan os.Signal, 1)
|
||||
|
|
Loading…
Reference in a new issue