User-Agent Header not used for TLS tunnel
See original GitHub issueIn case where HTTP tunnel is needed, the “User-Agent” header is reset and the default agent “okhttp/3.x.x” is used. This is causing the request being ignored as its considered to be originating from an unknown client.
Reference code from RealConnection.
/**
* Returns a request that creates a TLS tunnel via an HTTP proxy, or null if no tunnel is
* necessary. Everything in the tunnel request is sent unencrypted to the proxy server, so tunnels
* include only the minimum set of headers. This avoids sending potentially sensitive data like
* HTTP cookies to the proxy unencrypted.
*/
private Request createTunnelRequest() throws IOException {
return new Request.Builder()
.url(route.address().url())
.header("Host", Util.hostHeader(route.address().url(), true))
.header("Proxy-Connection", "Keep-Alive")
.header("User-Agent", Version.userAgent()) // For HTTP/1.0 proxies like Squid.
.build();
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
ETSI TS 124 109 V11.2.0 (2013-01)
The. User-Agent header field with GBA related "product" tokens shall be added to each outgoing HTTP request if the UE supports GBA-based authentication...
Read more >Are HTTPS headers encrypted? - Stack Overflow
A browser will only use SSL/TLS if instructed to, unencrypted HTTP is used first. Usually, this will result in a redirect to the...
Read more >HTTP Header Templates | ngrok documentation
This is empty for secure tunnels since there is no backend. Basic Auth Template Variables. Note: These values are only available when using...
Read more >user agent in http or https request - wireshark - Server Fault
yes ,. UA is the header field to do this , as all are saying and as you must be at the server...
Read more >Sample Code Illustrating a Secure Socket Connection ...
getDefault(); /* * Set up a socket to do tunneling through the proxy. * Start it off as a regular socket, ... By...
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
@JoshSolo you can hack this in with an
Authenticator
by following the instructions on pre-emptive authentication: https://square.github.io/okhttp/4.x/okhttp/okhttp3/-authenticator/#preemptive-authenticationWon’t fix.