cmd/derper: apply TCP keepalive and timeout to TLS as well

I missed a case in the earlier patch, and so we're still sending 15s TCP
keepalive for TLS connections, now adjusted there too.

Updates tailscale/corp#17587
Updates #3363

Signed-off-by: James Tucker <james@tailscale.com>
pull/11227/head
James Tucker 9 months ago committed by James Tucker
parent c9b6d19fc9
commit 0c5e65eb3f

@ -324,7 +324,7 @@ func main() {
}
}()
}
err = rateLimitedListenAndServeTLS(httpsrv)
err = rateLimitedListenAndServeTLS(httpsrv, &lc)
} else {
log.Printf("derper: serving on %s", *addr)
var ln net.Listener
@ -397,8 +397,8 @@ func defaultMeshPSKFile() string {
return ""
}
func rateLimitedListenAndServeTLS(srv *http.Server) error {
ln, err := net.Listen("tcp", cmp.Or(srv.Addr, ":https"))
func rateLimitedListenAndServeTLS(srv *http.Server, lc *net.ListenConfig) error {
ln, err := lc.Listen(context.Background(), "tcp", cmp.Or(srv.Addr, ":https"))
if err != nil {
return err
}

Loading…
Cancel
Save