Skip to content
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

Splithttp wrong apln structure [ "h2", "http/1.1" ] #3880

Closed
alireza-2030 opened this issue Oct 5, 2024 · 6 comments
Closed

Splithttp wrong apln structure [ "h2", "http/1.1" ] #3880

alireza-2030 opened this issue Oct 5, 2024 · 6 comments

Comments

@alireza-2030
Copy link

Is alpn equal to [ "h2" ] if it is [ "h2", "http/1.1" ] on the client ?
Because when the server is http/1.1 + tls but the client is h2 and http/1.1, it doesn't connect. But it connects when the client is only http/1.1.

@Fangliding
Copy link
Member

When the client has multiple values in apln, it will perform default behavior (if TLS is present, use h2)
If the server alpn only has http/1.1, but client want h2, it may cause handshake failure

@Fangliding Fangliding closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2024
@alireza-2030
Copy link
Author

When the client has multiple values in apln, it will perform default behavior (if TLS is present, use h2) If the server alpn only has http/1.1, but client want h2, it may cause handshake failure

There are some CDNs that connect sometimes with h2 and sometimes with http/1.1.
The fact that splithttp can't accept http/1.1 and h2 at the same time makes it difficult to connect to these CDNs.

@Fangliding
Copy link
Member

Fangliding commented Oct 5, 2024

When the client has multiple values in apln, it will perform default behavior (if TLS is present, use h2) If the server alpn only has http/1.1, but client want h2, it may cause handshake failure

There are some CDNs that connect sometimes with h2 and sometimes with http/1.1. The fact that splithttp can't accept http/1.1 and h2 at the same time makes it difficult to connect to these CDNs.

After discussion, we have decided not to implement the ALPN negotiation
This CDN behavior is really strange and beyond our scope of consideration. We might not change our decision just because of one CDN
My suggestion is to set two outbounds(one uses http/1.1, one uses h2) and use balancer to select the available one

@alireza-2030
Copy link
Author

I know that the alpn list is set by fingerprint, but does what I said have anything to do with fingerprint? What I said is the confirmation of alpn by the client.

As far as I understand, the reason for this error is that fingerprint sends a list of alpn including http/1.1 and h2, but when the server selects http/1.1, the client doesn't accept it. Isn't this an unreasonable limitation?!

@Fangliding

@Fangliding
Copy link
Member

Fangliding commented Oct 5, 2024

I know that the alpn list is set by fingerprint, but does what I said have anything to do with fingerprint? What I said is the confirmation of alpn by the client.

As far as I understand, the reason for this error is that fingerprint sends a list of alpn including http/1.1 and h2, but when the server selects http/1.1, the client doesn't accept it. Isn't this an unreasonable limitation?!

@Fangliding

The function of fingerprints is disguising, but it does not mean that they have all the functions of disguising targets

@mmmray
Copy link
Collaborator

mmmray commented Oct 7, 2024

but when the server selects http/1.1, the client doesn't accept it. Isn't this an unreasonable limitation?!

we are running into limitations of the golang ecosystem (or rather, utls) where we are unable to read the server's NextProtocol response and have it be respected in golang's HTTP stack. The fix was considered too complicated because setting alpn=http/1.1 for those cases seems practical enough (for now)

The actual fix is to get refraction-networking/utls#74 into utls, which as you can see is a monstrous amount of work.

We can keep it open as a "known issue" but at the same time we may never work on it (as fangliding said we consider those to be edgecases that are not worth the complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants