Should use the user-provided Host header for SNI
See original GitHub issueI’m trying to test Apache configuration in a Vagrant VM that forwards port 8443 to VM’s port 443. The command I’m running is:
$ http get https://localhost:443/ Host:www.example.com --verify=no
and I get a 400 Bad Request from Apache, because
[Mon Nov 23 09:43:17 2015] [error] Hostname localhost provided via SNI and hostname www.example.com provided via HTTP are different
I think httpie should use the user-provided Host header for the SSL negotiation, or perhaps even provide a command-line option to explicitly specify a hostname to use in SNI.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:6
- Comments:10
Top Results From Across the Web
SNI and Http Host header - Ravi Somepalli
Enter host header, web browsers will send a header as part of the http protocol that identities the requested domain name.
Read more >Should use the user-provided Host header for SNI #414 - GitHub
I think httpie should use the user-provided Host header for the SSL negotiation, or perhaps even provide a command-line option to explicitly ...
Read more >The curious case of curl, SSL SNI and the HTTP Host header
"SNI sends the hostname inside the TLS handshake (ClientHello). The server then chooses the correct certificate based on this information. Only ...
Read more >What is SNI? How TLS server name indication works
SNI, or Server Name Indication, is an extension for the TLS protocol to indicate a hostname in the TLS handshake. Learn more about...
Read more >tls - Host header is preferred by OpenSSL over SNI
The TLS session establishment does not take into account the Host: header of the HTTP request at all, so OpenSSL doesn't prefer the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
gnutls-cli
has the--sni-hostname=...
option. It would be great to have that forhttp
too, and it would prevent unexpected effects when re-using the value of a header for a different purpose (TLS and HTTP live on different OSI layers, so should be treated independently).Good point about cookies! What about
then?
I don’t like curl’s
--resolve
solution (aka #362) because it requires me to repeat the host name, which is unnecessary in 99% of use-cases. (It’s probably necessary if you want to follow redirects to a different domain name, that you’re also testing in Vagrant or something like that.)I don’t like the /etc/hosts solution because: