@google-cloud/pubsub version: 0.18.0const PubSub = require('@google-cloud/pubsub');
const config = {
projectId: 'my-awesome-project',
keyFilename: 'my-awesome-project-d8d7g557s8.json'
};
const topicName = 'product-connect-preprod';
let pubsub = new PubSub(config);
pubsub.createSubscription("interesting-topic", "subscriptionname")
.then(data => {
console.log(data);
})
.catch(err => {
console.error(err);
});
http_proxy=http://proxy.host:8080
HTTP_PROXY=http://proxy.host:8080
https_proxy=http://proxy.host:8080
HTTPS_PROXY=http://proxy.host:8080
I try to subscribe to a Google PubSub topic behind a corporate http proxy and get the following error:
Auth error:Error: write EPROTO 139711176046400:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:827:
The proxy is available via http only, but must be used for all connections. You'll find the same error in various bug pools of other projects, but none of the mentioned workarounds seem to work here.
@steffiisawesome thanks for the logging the issue. @stephenplusplus can you please take a look?
This seems like a possible duplicate of https://github.com/googleapis/nodejs-storage/issues/277, in that proxy problems all lead to an issue in one dependency. Please follow along there for some discussion that might be useful.
@stephenplusplus - What is the solution to this issue? The possible duplicate googleapis/nodejs-storage#277 you mentioned doesn't help, because the issue mentioned there is not solved.
@JustinBeckwith I believe you had been working on the Axios + Proxy issues-- do you know what became of that, and if your prior work would have fixed this?
Looks like it has been fixed in Axios with this release https://github.com/axios/axios/releases/tag/v0.19.0-beta.1 but GoogleApis for node is currently sitting at 0.18.0. @stephenplusplus @JustinBeckwith i have forks of the impacted repos that would need to change.
https://github.com/mainephd/node-gtoken
https://github.com/mainephd/gcp-metadata
https://github.com/mainephd/google-auth-library-nodejs
https://github.com/mainephd/nodejs-googleapis-common
https://github.com/mainephd/google-api-nodejs-client
I also noticed that some the libraries switched to gaxios namely gcp-metadata and gtoken. Is the goal to switch them all over to gaxios?
Aye, that's where we're headed.
Is there anything i can help with? @JustinBeckwith
I believe @ajaaym found a solution:
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.
Most helpful comment
Aye, that's where we're headed.