I am trying to get Dialogflow SDK samples from Google's Dialogflow v2 Node.js SDK to work. I am using node.js v8.10.0
, with dialogflow node.js SDK version 0.5.0
. I am encountering this issue when trying to run the "Detect Intent" sample, from behind a corporate http/s proxy:
Auth error:Error: write EPROTO 140163148314432:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:827
I came across this post here: https://medium.com/google-cloud/accessing-google-cloud-apis-though-a-proxy-fe46658b5f2a which seemed very java-oriented, but it suggested that the environment variable GRPC_PROXY_EXP
be set in order to get the gRPC calls to work behind a proxy. I set the environment variable in the shell from which I was running node with export GRPC_PROXY_EXP="$https_proxy"
and attempted to run the sample again, with the same issue. Note that my $http_proxy
, $https_proxy
variables are the same.
The same sample works from the same machine, when connected to a wifi network without the proxy; and a tcpdump
packet analysis indicates that there are two TCP connections (distinct ports) in-use: one which works (and is opened first), and one which doesn't, and encounters the error with the proxy. The second connection immediately begins the CLIENT_HELLO
TLS message, when it needs to first authenticate and send the HTTPS proxy the CONNECT
message (as the first TCP connection does).
Am I missing something, or is this an issue with the dialogflow (google-gax / grpc) node library?