serverless plugin behind proxy

1.2k views Asked by At

How can I use the command serverless plugin list behind proxy?
I am getting this error:

request to https://raw.githubusercontent.com/serverless/plugins/master/plugins.json failed, reason: connect ECONNREFUSED 151.101.84.133:443

The command serverless deploy works fine with my proxy, so the proxy and/or proxy configuration should not be the problem.

Versions

$ node --version
v11.1.0

$ npm --version
6.4.1

Environment variables

$ env | grep -i proxy
NO_PROXY=localhost,127.0.0.0/8,::1
http_proxy=http://localhost:3128/
npm_config_https_proxy=http://localhost:3128/
https_proxy=http://localhost:3128/
no_proxy=localhost,127.0.0.0/8,::1
npm_config_proxy=http://localhost:3128/

cURL

Even if I curl it, it works fine with my proxy settings. Truncated for brevity.

$ curl --verbose https://raw.githubusercontent.com/serverless/plugins/master/plugins.json
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 3128 (#0)
* Establish HTTP proxy tunnel to raw.githubusercontent.com:443
> CONNECT raw.githubusercontent.com:443 HTTP/1.1
> Host: raw.githubusercontent.com:443
> User-Agent: curl/7.47.0
> Proxy-Connection: Keep-Alive
> 
< HTTP/1.1 200 Connection established
< Connection: close
< 
* Proxy replied OK to CONNECT request
* found 155 certificates in /etc/ssl/certs/ca-certificates.crt
* found 625 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
*    server certificate verification OK
*    server certificate status verification SKIPPED
*    common name: www.github.com (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: C=US,ST=California,L=San Francisco,O=GitHub\, Inc.,CN=www.github.com
*    start date: Thu, 23 Mar 2017 00:00:00 GMT
*    expire date: Wed, 13 May 2020 12:00:00 GMT
*    issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert SHA2 High Assurance Server CA
*    compression: NULL
* ALPN, server accepted to use http/1.1
> GET /serverless/plugins/master/plugins.json HTTP/1.1
> Host: raw.githubusercontent.com
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
< Strict-Transport-Security: max-age=31536000
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-XSS-Protection: 1; mode=block
< ETag: "53374f2ed929f6d42faf13ebb025e0ff985941f1"
< Content-Type: text/plain; charset=utf-8
< Cache-Control: max-age=300
< X-Geo-Block-List:
< X-GitHub-Request-Id: 447E:6762:1CABB8:1E679B:5BEAD6AF
< Content-Length: 45355
< Accept-Ranges: bytes
< Date: Tue, 13 Nov 2018 13:50:39 GMT
< Via: 1.1 varnish
< Connection: keep-alive
< X-Served-By: cache-bma1635-BMA
< X-Cache: MISS
< X-Cache-Hits: 0
< X-Timer: S1542117040.576321,VS0,VE107
< Vary: Authorization,Accept-Encoding
< Access-Control-Allow-Origin: *
< X-Fastly-Request-ID: 929450c7326d8ce7c7ffa13174cbd80c86ecc255
< Expires: Tue, 13 Nov 2018 13:55:39 GMT
< Source-Age: 0
< 
[
1

There are 1 answers

0
Azize On

This was identified as a bug in serverless plugin according to this issue:
https://github.com/serverless/serverless/issues/5480

The solution will come from this PR:
https://github.com/serverless/serverless/pull/5481

serverless plugin simple does not support proxy up to this version.