Merge pull request #261 from sgotti/add_listenandservetls

*: call ListenAndServeTLS when tls is enabled in config
This commit is contained in:
Simone Gotti 2021-03-19 12:25:07 +01:00 committed by GitHub
commit 43d73ec064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
util.GoWait(&wg, func() {
if !s.c.Web.TLS {
lerrCh <- httpServer.ListenAndServe()
} else {
lerrCh <- httpServer.ListenAndServeTLS("", "")
}
})
defer httpServer.Close()

View File

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

View File

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

View File

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

View File

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