Don't add "irc" in ALPN list for WebSocket servers
This is incorrect because HTTP listeners don't handle plain IRC connections. This also prevents net/http from setting up an HTTP/2 server.
This commit is contained in:
parent
e35a116188
commit
0c0397407c
@ -55,10 +55,7 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("failed to load TLS certificate and key: %v", err)
|
log.Fatalf("failed to load TLS certificate and key: %v", err)
|
||||||
}
|
}
|
||||||
tlsCfg = &tls.Config{
|
tlsCfg = &tls.Config{Certificates: []tls.Certificate{cert}}
|
||||||
NextProtos: []string{"irc"},
|
|
||||||
Certificates: []tls.Certificate{cert},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
srv := soju.NewServer(db)
|
srv := soju.NewServer(db)
|
||||||
@ -89,7 +86,9 @@ func main() {
|
|||||||
if _, _, err := net.SplitHostPort(host); err != nil {
|
if _, _, err := net.SplitHostPort(host); err != nil {
|
||||||
host = host + ":6697"
|
host = host + ":6697"
|
||||||
}
|
}
|
||||||
ln, err := tls.Listen("tcp", host, tlsCfg)
|
ircsTLSCfg := tlsCfg.Clone()
|
||||||
|
ircsTLSCfg.NextProtos = []string{"irc"}
|
||||||
|
ln, err := tls.Listen("tcp", host, ircsTLSCfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("failed to start TLS listener on %q: %v", listen, err)
|
log.Fatalf("failed to start TLS listener on %q: %v", listen, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user