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.
This commit is contained in:
parent
c5d5259243
commit
d1181b3e7a
@ -156,6 +156,9 @@ func main() {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
case "wss":
|
case "wss":
|
||||||
|
if tlsCfg == nil {
|
||||||
|
log.Fatalf("failed to listen on %q: missing TLS configuration", listen)
|
||||||
|
}
|
||||||
addr := u.Host
|
addr := u.Host
|
||||||
if _, _, err := net.SplitHostPort(addr); err != nil {
|
if _, _, err := net.SplitHostPort(addr); err != nil {
|
||||||
addr = addr + ":https"
|
addr = addr + ":https"
|
||||||
|
Loading…
Reference in New Issue
Block a user