*: call ListenAndServeTLS when tls is enabled in config

This commit is contained in:
Simone Gotti 2021-03-19 10:52:32 +01:00
parent 291ed3d440
commit 0544586ade
5 changed files with 25 additions and 5 deletions

View File

@ -397,7 +397,11 @@ func (s *Configstore) run(ctx context.Context) error {
lerrCh := make(chan error, 1) lerrCh := make(chan error, 1)
util.GoWait(&wg, func() { util.GoWait(&wg, func() {
if !s.c.Web.TLS {
lerrCh <- httpServer.ListenAndServe() lerrCh <- httpServer.ListenAndServe()
} else {
lerrCh <- httpServer.ListenAndServeTLS("", "")
}
}) })
defer httpServer.Close() defer httpServer.Close()

View File

@ -1475,7 +1475,11 @@ func (e *Executor) Run(ctx context.Context) error {
} }
lerrCh := make(chan error) lerrCh := make(chan error)
go func() { go func() {
if !e.c.Web.TLS {
lerrCh <- httpServer.ListenAndServe() lerrCh <- httpServer.ListenAndServe()
} else {
lerrCh <- httpServer.ListenAndServeTLS("", "")
}
}() }()
select { select {

View File

@ -350,7 +350,11 @@ func (g *Gateway) Run(ctx context.Context) error {
lerrCh := make(chan error) lerrCh := make(chan error)
go func() { go func() {
if !g.c.Web.TLS {
lerrCh <- httpServer.ListenAndServe() lerrCh <- httpServer.ListenAndServe()
} else {
lerrCh <- httpServer.ListenAndServeTLS("", "")
}
}() }()
select { select {

View File

@ -172,7 +172,11 @@ func (s *Gitserver) Run(ctx context.Context) error {
lerrCh := make(chan error) lerrCh := make(chan error)
go func() { go func() {
if !s.c.Web.TLS {
lerrCh <- httpServer.ListenAndServe() lerrCh <- httpServer.ListenAndServe()
} else {
lerrCh <- httpServer.ListenAndServeTLS("", "")
}
}() }()
select { select {

View File

@ -403,7 +403,11 @@ func (s *Runservice) run(ctx context.Context) error {
lerrCh := make(chan error, 1) lerrCh := make(chan error, 1)
util.GoWait(&wg, func() { util.GoWait(&wg, func() {
if !s.c.Web.TLS {
lerrCh <- httpServer.ListenAndServe() lerrCh <- httpServer.ListenAndServe()
} else {
lerrCh <- httpServer.ListenAndServeTLS("", "")
}
}) })
select { select {