From 99b10537ba8517947d75e0b02bd8d7d803fdfbf5 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 26 Jul 2017 10:44:38 -0400 Subject: [PATCH] enable redirect for http to https when certs provided --- cmd/drone-server/server.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/cmd/drone-server/server.go b/cmd/drone-server/server.go index a48fd6b97..9c46aa897 100644 --- a/cmd/drone-server/server.go +++ b/cmd/drone-server/server.go @@ -508,12 +508,18 @@ func server(c *cli.Context) error { // start the server with tls enabled if c.String("server-cert") != "" { - return http.ListenAndServeTLS( - c.String("server-addr"), - c.String("server-cert"), - c.String("server-key"), - handler, - ) + g.Go(func() error { + return http.ListenAndServe(":http", handler) + }) + g.Go(func() error { + return http.ListenAndServeTLS( + ":https", + c.String("server-cert"), + c.String("server-key"), + handler, + ) + }) + return g.Wait() } // start the server without tls enabled