question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTTPS Over HTTP Proxy Tunneling Issue

See original GitHub issue

Environment 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

  1. 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.
  2. 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
  3. 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JustinBeckwithcommented, Jan 4, 2019

👋 The issue with capitalization was fixed here: https://github.com/JustinBeckwith/gaxios/commit/b5edd2de974545ec7c401e358efbd99271663fd0

And a new release was cut 😃

0reactions
hiranya911commented, Dec 16, 2018

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:

  • v2.3.0 of the library uses Axios, which has a known issue with HTTPS proxy discovery. This breaks the library when HTTPS_PROXY env variable is set.
  • v2.3.1 uses gaxios, which supports proxy servers correctly, but one must set the https_proxy environment variable (i.e. as opposed to HTTPS_PROXY):

https://github.com/JustinBeckwith/gaxios/blob/db3b02b36b78e70ee1d93ad0485826fd7c058d67/src/gaxios.ts#L134-L142

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found