-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
native-tis-alpn feature overrides request's host header #2263
Comments
Hm, I searched through reqwest, and nothing adjusts the |
Hey seanmonstar, thanks for reply |
It could be something inside native-tls that gets enabled when ALPN is turned on? I've checked again, and I'm 99.9% sure that nothing else changes the actual |
Actually, just after writing that: it might be that with ALPN, that means it's negotiating HTTP/2. If so, that protocol does not use the |
Thanks Sean for suggestions, I followed up on your suggestion Checking for HTTP2It does indeed use HTTP2, however I don't understand that if HTTP2 does not need host header, why would client modify it? Shouldn't we still preserve the host header? (Ex. curl preserves host header input when using http2 Anyways some reqwest logs which verified alpn using http2
Good news is that I tested with
Going forward
|
Hello,
I have a reverse proxy service that is getting request and passing it to Reqwest to proxy to a different backend service. I want to preserve the incoming host header and have Reqwest client pass it to backend. Ex. request-> "my_service.com" -> "my_backend.com"
Both
native-tls
andrustls
preserves the host header value, but whennative-tls-alpn
is enabled, host header is overridden to with reqwest's url's domainTesting
https://postman-echo.com/get
to echo back what the client sentUsing
native-tis
andrustls
Postman Output
Can see that its using the host header I've provided
Using
native-tls-alpn
Postman Output
Can see that host header has been overridden
Why don't you just not use
native-tls-alpn
?I have a hard dependency that use
Reqwest
with this feature, so it gets added to myReqwest
client via feature unificationQuestion
Was this intended behavior for
native-tls-alpn
or is this some kind of bug?Feature Request
I tried
use_rustls_tls()
oruse_native_tls()
(ref) in ClientBuilder while I havenative-tls-alpn
feature enabled in hopes to isolate my client, but lead to same host override behavior. I feel like these functions should isolate itself fromnative-tls-alpn
settings. Perhaps with that isolation and newuse_native_tls_alpn()
function, people can choose which specific backend to use for tls more specifically, especially when dependencies change backend tls (https://docs.rs/reqwest/latest/reqwest/tls/index.html)The text was updated successfully, but these errors were encountered: