~emersion/soju

d1181b3e7a3aa6ab279714dcccde043b1b0d14bf — Rafael Castillo 16 days ago c5d5259
Check for TLS config in wss listeners

Previously http.Server.ListenAndServeTLS would return a not very helpful
error about a failed open. This adds a check similar to the one in the
ircs case that should make it clearer to operators what the error is.
1 files changed, 3 insertions(+), 0 deletions(-)

M cmd/soju/main.go
M cmd/soju/main.go => cmd/soju/main.go +3 -0
@@ 156,6 156,9 @@ func main() {
				}
			}()
		case "wss":
			if tlsCfg == nil {
				log.Fatalf("failed to listen on %q: missing TLS configuration", listen)
			}
			addr := u.Host
			if _, _, err := net.SplitHostPort(addr); err != nil {
				addr = addr + ":https"