Check for TLS config in wss listeners v1 APPLIED

Rafael Castillo: 1
 Check for TLS config in wss listeners

 1 files changed, 3 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/soju-dev/patches/25075/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] Check for TLS config in wss listeners Export this patch

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.
 cmd/soju/main.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cmd/soju/main.go b/cmd/soju/main.go
index 974881b..9f67182 100644
--- a/cmd/soju/main.go
+++ b/cmd/soju/main.go
@@ -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"
Pushed, thanks!