seanmonstar / reqwest

An easy and powerful Rust HTTP Client
https://docs.rs/reqwest
Apache License 2.0
9.92k stars 1.12k forks source link

PROTOCOL_ERROR when trying to connect to https://www.google.com with use_rustls_tls #893

Open glebpom opened 4 years ago

glebpom commented 4 years ago

Disabling rustls_tls makes it work just good

Darkspirit commented 4 years ago

If you use HTTP/2 you must not set a Host header, let hyper do that automatically for you (for HTTP/1). (https://github.com/hyperium/hyper/issues/2079)

glebpom commented 4 years ago

Thanks, that was not obvious. Wouldn't it make sense to make it a hard error?

Darkspirit commented 4 years ago

hyper-rustls advertises h2 + http/1.1 ALPN by default. I don't think reqwest targets users who need custom Host headers. (?) Reqwest should return an error on them or remove them. In worst case it should be put behind a feature flag.