HTTPS Over HTTP Proxy Tunneling Issue
See original GitHub issueEnvironment details
- OS: Ubuntu Linux 16.04
- Node.js version: 8.10.0
- npm version: 5.10.0
gtoken
version: 2.3.0
Steps to reproduce
- Be behind a corporate proxy doing HTTPS over HTTP tunneling. The HTTPS_PROXY environment variable will be set to http://xxxxxx:8080 or some other unsecured port to capture local traffic for retention.
- Use Google Dialogflow 0.5.0, 0.6.0 or other Google Cloud Service library that relies on google-gax 0.17.1 -> google-auth-library 1.6.1 -> gtoken 2.3.0 in its dependency tree as determined by
npm ls gtoken
- Notice that there will be an error from openssl dumped to the console along the lines of “invalid protocol”. (One example is Auth error:Error: write EPROTO 140533291190080:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:…/deps/openssl/openssl/ssl/s23_clnt.c:827:)
I am not an expert in the Google API architecture, but it appears that the issue is caused when GToken uses axios to facilitate its underlying HTTPS connection to authenticate with Google APIs. Axios documentation covers a lot of ground, but the basic feature necessary is to not assume that the proxy protocol is HTTPS just because the destination URL is. Maybe there is a way to use Axios differently in this case? Maybe use whatever HTTP library other areas of the google-gax / grpc projects use to successfully capture project metadata etc. through a proxy configured this way? Maybe this problem has already been fixed? I don’t know, but hopefully this report helps someone other than me 😄
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Proxy servers and tunneling - HTTP - MDN Web Docs
This is how a client behind an HTTP proxy can access websites using SSL (i.e. HTTPS, port 443). Note, however, that not all...
Read more >Proxy support does not work properly with CONNECT ... - GitHub
Describe the bug Using Axios 0.26.1 behind a corporate HTTP tunneling proxy to an HTTPS destination, once the proxy connection is made, ...
Read more >Failing to connect to HTTPS service using HTTP tunnel proxy ...
The "proxy tunnel" is HTTP, but the local firewall rules require that the connection be initiated with 'https'.
Read more >503 Service Unavailable - Proxy tunnel creation failed with 403
The proxy server opens a secure (HTTPS) or non-secure (HTTP) connection to the backend server depending on the proxy type (indicated by the ......
Read more >SSL proxy connect tunneling does not use correct target host
SSL proxy connect tunneling does not use correct target host and port. Download Description. PK59474 resolves the following problem: ERROR DESCRIPTION: A Web...
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 Free
Top 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
👋 The issue with capitalization was fixed here: https://github.com/JustinBeckwith/gaxios/commit/b5edd2de974545ec7c401e358efbd99271663fd0
And a new release was cut 😃
Just ran into this while trying to use Cloud Firestore (see https://github.com/googleapis/google-auth-library-nodejs/issues/571 and https://github.com/googleapis/nodejs-firestore/issues/493 for full context). After a bit of experimenting, here’s what I’ve found out:
HTTPS_PROXY
env variable is set.https_proxy
environment variable (i.e. as opposed toHTTPS_PROXY
):https://github.com/JustinBeckwith/gaxios/blob/db3b02b36b78e70ee1d93ad0485826fd7c058d67/src/gaxios.ts#L134-L142