HTTPS_PROXY with HTTP Proxy fail to connect
See original GitHub issueEnvironment details
- OS: all
- Node.js version: 8.11.*
- npm version: 5.6.0
@google-cloud/logging
version: 4.1.1
Steps to reproduce
-
Setup a http Proxy
docker run --publish 3128:3128 sameersbn/squid:3.3.8-23
-
Start a logging instance with HTTPS_PROXY env
HTTPS_PROXY=http://proxy... node script.js
-
try to log
const { Logging } = require('@google-cloud/logging');
if (process.env.GOOGLE_APPLICATION_CREDENTIALS) {
const logging = new Logging({
projectId: 'process.env.PROJECTID',
});
const logName = 'my-log';
const log = logging.log(logName);
const metadata = {
resource: { type: 'global' },
};
const entry = log.entry(metadata, { logDate: Date.now() });
log.info(entry, console.log);
};
Expected
Logging of the Logdata
Actual
Receiving Error:
Auth error:Error: write EPROTO 4409435584:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:252:
{ Error: 14 UNAVAILABLE: Getting metadata from plugin failed with error: write EPROTO 4409435584:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:252:
at Object.exports.createStatusError (/Users/name/source/project/node_modules/grpc/src/common.js:87:15)
at Object.onReceiveStatus (/Users/name/source/project/node_modules/grpc/src/client_interceptors.js:1188:28)
at InterceptingListener._callNext (/Users/name/source/project/node_modules/grpc/src/client_interceptors.js:564:42)
at InterceptingListener.onReceiveStatus (/Users/name/source/project/node_modules/grpc/src/client_interceptors.js:614:8)
at callback (/Users/name/source/project/node_modules/grpc/src/client_interceptors.js:841:24)
It seems that the Error is based in GRPC and there is no support for proxies.
The only alternative in my case is to use the REST API direct, but it is not recommended.
Similar issue but for axios: https://github.com/googleapis/nodejs-storage/issues/277
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to Fix Unable to Connect to the Proxy Server | VSS Guide
If you are still unable to connect to proxy server, you can clear the browser cache. Clearing browser cache will remove corrupt scripts...
Read more >HTTPS Proxy connections fail with certificate_unknown error
Problem. Attempts to connect to an HTTPS SSL site via the Rational Integration Tester (RIT) HTTP Proxy fail. The Proxy log reports "Received ......
Read more >Unable to connect through HTTPS proxy · Issue #330 - GitHub
If using an HTTPS Only proxy it will fail; This is because the server is attempting to use the proxy as an HTTP...
Read more >Can't consume web services via an HTTP proxy server - .NET ...
This article provides a resolution to fix the error that occurs on a .NET client that consumes a Web service via an HTTP...
Read more >Using HTTP Proxy Server Over SSL Fails with Error "Failed to ...
Symptoms. Seeing the following error when using the HTTP Proxy with HTTPS protocol: error "Failed to communicate with proxy: null/-1"
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
@refextu can you please try setting both env variable
https_proxy
&HTTPS_PROXY
GRPC uses https_proxy and authentication which goes through normal node request uses HTTPS_PROXY. Its working fine for me following your steps, below is the log.@ajaaym I can confirm that this working as expected.
HTTPS_PROXY=http://localhost:3128 node script.js
andhttps_proxy=http://localhost:3128 node script.js
logs perfectly to google cloud