-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Fix for ipv6 link local with scope #9326
Conversation
|
"ipv6%wlan0" is all-ASCII. What is the non-ASCII character? SNI should not be used with IP addresses. It is domain names only. It sounds like instead we may need logic to detect IP addresses and ignore them. |
Using SNI_HOST_NAME.newInstance(string) raises The input does not conform to the STD 3 ASCII rules.. I'm not familiar with the grpc library to do what you are suggesting, but the current proposal solves the issue. |
Looks like that's talking about https://unicode.org/reports/tr46/#STD3_Rules or similar. So it is the % sign causing the error. It looks like you are forcing it to go through punycoding processing instead. I honestly don't know at what level punycode should be applied, but it is still the inappropriate behavior in your case. In your case SNI should not be used at all. Easiest immediate fix I see is to skip the invoke() if InetAddresses.isInetAddress() returns true. |
Using |
I added this to a test and it passed: assertEquals(true, com.google.common.net.InetAddresses.isInetAddress("fe80::2ab:48ff:fe1f:402d%wlan0")); It works without the %wlan0 as well. |
Sorry the hostname value has brackets it's |
The brackets are needed due this issue, I think. #4278 |
We could just throw https://guava.dev/releases/snapshot/api/docs/com/google/common/net/HostAndPort.html at this. Although that seems a bit out-of-place. I think we might should use HostAndPort here instead of URI: grpc-java/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java Lines 767 to 774 in d4fa0ec
|
Ugh, no. That would break the hostname verifier. It looks like we should be passing host+port to hostname verifier or something. I'm fine with just throwing HostAndPort in the TLS code and we kick the can down the road. |
I didn't get the suggestion. |
Combine both methods: |
I'll do more test and let you know if everything went well soon. |
It worked well. Thank you for the suggestion. About the checking failing, what do I need to do? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not all that confident that we understand how the SET_HOSTNAME path works, but this works and the SET_HOSTNAME code path may just become a noop.
I think we'll ignore the lack of test that the codecov/patch status is complaining about. We could add a test to Http2OkHttpTest, but it might break in some environments. Last time we tried (many years ago) it was a pain, and I think I recall more recent cases where even IPv6 loopback is not available. It is possible to cook up an Assumes to skip the test when IPv6 is unavailable, but seems annoying. (Maybe try to bind to [::1]:0 and if we can't then skip the test?) |
How long does it take to merge and have a new release with the fix? |
This will be backported to the release scheduled for next week. |
This reverts commit c1abc7f. It produced compilation issues inside Google. I strongly suspect it isn't this commit or gRPC's fault, but it prevents further testing until it is resolved.
This reverts commit c1abc7f. It produced compilation issues inside Google. I strongly suspect it isn't this commit or gRPC's fault, but it prevents further testing until it is resolved.
This reverts commit c1abc7f. It produced compilation issues inside Google. I strongly suspect it isn't this commit or gRPC's fault, but it prevents further testing until it is resolved.
This reverts commit c1abc7f. It produced compilation issues inside Google. I strongly suspect it isn't this commit or gRPC's fault, but it prevents further testing until it is resolved.
This reverts commit c1abc7f. It produced compilation issues inside Google. I strongly suspect it isn't this commit or gRPC's fault, but it prevents further testing until it is resolved.
Fix for ipv6 link local with scope. If you try to connect passing address like "ipv6%wlan0" it will use
Which raises hostname is not valid because this method doesn't accept non ASCII characters. With the change it will use
Now scoped ipv6 link is supported. 😄