-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto/tls: ClientHelloInfo.Conn field is nil (or return value of RemoteAddr()) #61639
Comments
To be clear, the stack trace indicates the execution of |
cc @neild |
This is an HTTP/3 request.
We should document that Perhaps we should also populate |
A QUIC stack needs to do better than this. There needs to be a way to retrieve the remote (and maybe local) address, since certificate selection (or even rejection of the handshake) might depend on these. In quic-go, I used to solve this by creating a fake If crypto/tls doesn't add this function, I expect that QUIC stacks built on top of crypto/tls will need to wrap |
Thanks both. It's really important to get the remote IP, whether it's UDP or TCP. This is crucial for DoS protection, rate limiting, etc. Our users sometimes do vary certificate selection on the remote host, or reject handshakes. My opinion is that that since QUIC has "virtual" connections (basically?), I'd still expect at least some of the methods to work on net.Conn. |
QUIC connections don't necessarily have a stable local or remote address, but they do during the handshake and exposing those addresses seems reasonable. A couple options I can think of:
We could also have |
Thanks for the careful consideration on this. I'll let Marten give his thoughts on the proposed API, since we use it only indirectly through quic-go at this time; for us, as long as the ClientHelloInfo.Conn is not nil and can return a RemoteAddr, that is all we need :) |
We don't have time to add any API for this in 1.21, but that should be fine; quic-go can wrap the An immediate question for 1.21 and the future is what |
Gotcha, makes sense. I'd personally prefer to have a "fake" net.Conn as long as it returns usable address values for |
@neild Should we aim to resolve this issue for Go 1.22? This issue is one of the reasons why QUIC implementations need to clone the |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Reproducable with
go1.21rcX
Not reproducable with
<go1.20.6
What operating system and processor architecture are you using (
go env
)?Debian 12.1 amd64
go env
OutputWhat did you do?
Trying to run Caddy webserver (
Version v2.7.0-beta.2.0.20230725185021-d7d16360d411 h1:Hq2Ph3i47imGFwMmyEb8g8ExG2G9ISJlQJ6R73ddb6E=
) with go1.21rc3 as described here but it panics after some time..Logs
It looks like "ClientHelloInfo.Conn field is nil (or maybe just the return value of RemoteAddr() is)" (Thanks @mholt)
What did you expect to see?
Caddy webserver in operating state without any panics.
What did you see instead?
Caddy webserver keeps panicking irregularly.
The text was updated successfully, but these errors were encountered: