forked from quic-go/quic-go
fix TLS initialization for the TCP h2quic Server
This commit is contained in:
committed by
Marten Seemann
parent
faa8a1ec1a
commit
ce9132e324
@@ -344,6 +344,9 @@ func ListenAndServe(addr, certFile, keyFile string, handler http.Handler) error
|
|||||||
}
|
}
|
||||||
defer tcpConn.Close()
|
defer tcpConn.Close()
|
||||||
|
|
||||||
|
tlsConn := tls.NewListener(tcpConn, config)
|
||||||
|
defer tlsConn.Close()
|
||||||
|
|
||||||
// Start the servers
|
// Start the servers
|
||||||
httpServer := &http.Server{
|
httpServer := &http.Server{
|
||||||
Addr: addr,
|
Addr: addr,
|
||||||
@@ -365,7 +368,7 @@ func ListenAndServe(addr, certFile, keyFile string, handler http.Handler) error
|
|||||||
hErr := make(chan error)
|
hErr := make(chan error)
|
||||||
qErr := make(chan error)
|
qErr := make(chan error)
|
||||||
go func() {
|
go func() {
|
||||||
hErr <- httpServer.Serve(tcpConn)
|
hErr <- httpServer.Serve(tlsConn)
|
||||||
}()
|
}()
|
||||||
go func() {
|
go func() {
|
||||||
qErr <- quicServer.Serve(udpConn)
|
qErr <- quicServer.Serve(udpConn)
|
||||||
|
|||||||
Reference in New Issue
Block a user