Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

[Proxy] Error: tunneling socket could not be established #338

Closed
Fank opened this issue Apr 8, 2015 · 31 comments
Closed

[Proxy] Error: tunneling socket could not be established #338

Fank opened this issue Apr 8, 2015 · 31 comments

Comments

@Fank
Copy link

Fank commented Apr 8, 2015

I can't install packages if proxy is configured.
This happens in atom version >0.188.0 and with every command (install, update ...) or package

$ apm update
Package Updates Available (3)
├── autocomplete-plus 2.7.1 -> 2.9.0
├── minimap 4.7.5 -> 4.7.6
└── uglify 1.2.0 -> 1.2.1

Would you like to install these updates? (yes) yes

Installing autocomplete-plus@2.9.0 to /home/mfkinder/.atom/packages 
gyp info it worked if it ends with ok
gyp info using node-gyp@1.0.2
gyp info using node@0.10.35 | linux | x64
gyp http GET https://atom.io/download/atom-shell/v0.22.0/node-v0.22.0.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! install error 
gyp ERR! stack Error: tunneling socket could not be established, cause=Parse Error
gyp ERR! stack     at ClientRequest.onError (/usr/share/atom/resources/app/apm/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:168:17)
gyp ERR! stack     at ClientRequest.g (events.js:180:16)
gyp ERR! stack     at ClientRequest.emit (events.js:95:17)
gyp ERR! stack     at Socket.socketOnData (http.js:1593:9)
gyp ERR! stack     at TCP.onread (net.js:528:27)
gyp ERR! System Linux 3.16.0-34-generic
gyp ERR! command "/usr/share/atom/resources/app/apm/bin/node" "/usr/share/atom/resources/app/apm/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "install" "--target=0.22.0" "--dist-url=https://atom.io/download/atom-shell" "--arch=x64" "--ensure" "--proxy=http://srv-proc005.stuttgart.mcl.local:8080/"
gyp ERR! cwd /home/mfkinder/.atom
gyp ERR! node -v v0.10.35
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
$ apm -v
apm  0.157.0
npm  2.5.1
node 0.10.35
python 2.7.8
git 2.1.0
$ cat ~/.atom/.apmrc 
proxy=http://my-proxy:8080/
https-proxy=http://my-proxy:8080

I used following commands to set the proxy config:

apm config set proxy http://my-proxy:8080
apm config set https-proxy http://my-proxy:8080
@Fank
Copy link
Author

Fank commented Apr 8, 2015

0.188.0 fine
0.189.0 error
0.190.0 error

@Fank Fank changed the title Error: tunneling socket could not be established [Proxy] Error: tunneling socket could not be established Apr 8, 2015
@Fank
Copy link
Author

Fank commented Apr 8, 2015

$ curl -v https://atom.io/download/atom-shell/v0.22.0/node-v0.22.0.tar.gz
* Hostname was NOT found in DNS cache
*   Trying 123.123.123.123...
* Connected to my-proxy (123.123.123.123) port 8080 (#0)
* Establish HTTP proxy tunnel to atom.io:443
> CONNECT atom.io:443 HTTP/1.1
> Host: atom.io:443
> User-Agent: curl/7.37.1
> Proxy-Connection: Keep-Alive
> 
< HTTP/1.1 200 Connection established
< Via: 1.1 SRV-PROC005
< Connection: Keep-Alive
< Proxy-Connection: Keep-Alive
< 
* Proxy replied OK to CONNECT request
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* Server certificate:
*    subject: C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=*.atom.io
*    start date: 2014-04-09 00:00:00 GMT
*    expire date: 2017-04-12 12:00:00 GMT
*    subjectAltName: atom.io matched
*    issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 High Assurance Server CA
*    SSL certificate verify ok.
> GET /download/atom-shell/v0.22.0/node-v0.22.0.tar.gz HTTP/1.1
> User-Agent: curl/7.37.1
> Host: atom.io
> Accept: */*
> 
< HTTP/1.1 302 Found
* Server Cowboy is not blacklisted
< Server: Cowboy
< Date: Wed, 08 Apr 2015 14:59:45 GMT
< Connection: keep-alive
< Strict-Transport-Security: max-age=631152000
< X-Frame-Options: DENY
< X-Xss-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< Content-Security-Policy: default-src 'self'; connect-src 'self'; font-src 'self'; frame-src 'self'; img-src https://* 'self' data:; media-src 'none'; object-src 'self'; script-src 'self' 'unsafe-inline' https://ssl.google-analytics.com https://www.google-analytics.com; style-src 'self' 'unsafe-inline';
< Location: http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist/v0.22.0/node-v0.22.0.tar.gz
< Content-Type: text/html; charset=utf-8
< Cache-Control: no-cache
< Set-Cookie: request_method=GET; path=/; secure
< X-Request-Id: 39e22b3f-7cf4-45d1-8acc-9c706ec1d323
< X-Runtime: 0.013397
< Transfer-Encoding: chunked
< Via: 1.1 vegur
< 
* Connection #0 to host my-proxy left intact
<html><body>You are being <a href="http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist/v0.22.0/node-v0.22.0.tar.gz">redirected</a>.</body></html>

if i use curl on http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist/v0.22.0/node-v0.22.0.tar.gz ill get the tarball content

@Fank
Copy link
Author

Fank commented Apr 8, 2015

Here a apm verbose version: https://gist.github.com/Fank/6fe10a0b3596815b0622

@nisargjhaveri
Copy link

Same error with

apm  0.157.0
npm  2.5.1
node 0.10.35
python 2.7.6
git 1.9.1

@h-no
Copy link

h-no commented Apr 9, 2015

Seems like a duplicate of #322

@Fank
Copy link
Author

Fank commented Apr 11, 2015

Yea its exactly the same issue

@Fank Fank closed this as completed Apr 11, 2015
@searpro
Copy link

searpro commented May 19, 2015

try
apm set strict-ssl false
This solved my issue on windows machine

@ghost
Copy link

ghost commented Jul 7, 2015

I have strict-ssl false and http/https proxy set on Mac, but still have the issue. Any fix planned?

@ghost
Copy link

ghost commented Jul 7, 2015

The workaround here fixed my problem: #322

@umbraesoulsbane
Copy link

I am also having issues. This is a real deal killer. Atom looks awesome, but is crippled by "tunneling socket could not be established, cause=Parse Error". I have tried all the work arounds and have my proxy set: all on a fresh download and install of Atom as of today.

Even trying to manually download and installing packages is useless as I get the same error pointing to a local folder as the package manager seems to still want to phone home. This makes this product completely useless for a corporate developer.

I have tried several other IDEs (Aptana, Eclipse, Sublime, etc) and none have this issue. Personally I think this issue need immediate and critical attention. If this worked my company would have hundreds of developers using it, but as it it is less functional than notepad.

@superhoang
Copy link

ver
Microsoft Windows [Version 6.1.7601]

apm -v
apm 1.0.5
npm 2.13.3
node 0.10.40
python 3.1.1
git 1.9.5.msysgit.0
visual studio 2013

I have tried the following to no avail :

Environment variable
ATP_NODE_URL=http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist

.atom.apm.aprmc
proxy=http://my.corporate.proxy:8080/
http-proxy=http://my.corporate.proxy:8080/
https-proxy=http://my.corporate.proxy:8080/
strict-ssl=false

also tried
.atom.apm.aprmc
proxy=http://myUsername:myPassword@my.corporate.proxy:8080/
http-proxy=http://myUsername:myPassword@my.corporate.proxy:8080/
https-proxy=http://myUsername:myPassword@my.corporate.proxy:8080/
strict-ssl=false

But still have tunneling socket could not be established, cause=Parse Error

Maybe the workaround doesn't work because I can't access http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist ?
response output is :
<?xml version="1.0" encoding="UTF-8"?> <Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>218AA3E877344E8C</RequestId><HostId>wxK5DafJ3UppXZ3LnGov8iUF3j4fyDTq4EhM+fRfAekyoRymvuyJHP1Das7XR1ynf0nUSbH3oHU=</HostId></Error>
Any update on this issue ?

@DennisAhaus
Copy link

Same error. Tried everything apm config set https-proxy... set http_proxy=... change file .atom/.apmrc

Not possible to get atom/apm working behind a proxy!

@winstliu
Copy link
Contributor

winstliu commented Dec 8, 2015

@DennisAhaus could you try HTTPS_PROXY/HTTP_PROXY instead?

@chauhraj
Copy link

I too get this error behind the proxy and followed advice including setting HTTP_PROXY. It works with npm but failing with apm.

@filipegorges
Copy link

I'm also having issues with proxies:

tunneling socket could not be established, cause=2552:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:782:

Are there any fixes planned?
Thanks

@davelander
Copy link

I had this issue - changed the proxy strings to include authentication and it now works:
http://user:password@my.proxy:8080

@chauhraj
Copy link

@davelander, did you set HTTP_PROXY and HTTPS_PROXY in the environment settings or some other property somewhere else? I am using Windows 7. That shouldn't make a difference but still.

@davelander
Copy link

@chauhraj just through apm, although we use the same proxy for http and https

apm config set http-proxy http://user:password@my.proxy:8000
apm config set https-proxy http://user:password@my.proxy:8000
apm config set strict-ssl false

npm config ls -l
also lists proxy settings (may have set them up earlier...?)

npm config set proxy http://user:password@my.proxy:8000
npm config set https-proxy http://user:password@my.proxy:8000
npm config set strict-ssl false

@Tset-Noitamotua
Copy link

Tset-Noitamotua commented Jul 19, 2016

POST EDIT
If you are on Windows do NOT read further! Jump right away to THE SOLUTION!!!
BUT ATTENTION: when you jump to the solution, turn on your eagle vision, put on your glasses, take a microscope or whate ever - just look carefully, it´s just one line which you are looking for ... actually it is just one character!
END POST EDIT

So disappointing ... I´ve tried every mentioned suggestion above and more (mentioned in #322) ... and nothing worked!!!

Is it so difficult to write up three lines for stupid Windows users working for big companies? ;-)

For everybody on Windows behind corporate proxy DONT EVEN TRY one of the following - it´s useless:

$ apm install language-robot-framework
Installing language-robot-framework to C:\Users\me\.atom\packages failed
Request for package information failed: getaddrinfo EAGAIN (EAGAIN)

or this:

$ apm install language-robot-framework
Installing language-robot-framework to C:\Users\me\.atom\packages failed
Request for package information failed: tunneling socket could not be established, cause=10732:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:782:
 (5 attempts) (ECONNRESET)

or (for the last one) this:

$ HOME=/c/Users/me/.atom/.node-gyp/ /c/Users/me/AppData/Local/atom/app-1.8.0/resources/app/apm/bin /node /c/Users/me/AppData/Local/atom/app-1.8.0/resources/app/apm/node_modules/npm/node_modules/node- gyp/bin/node-gyp.js "install" "--target=0.36.8" "--dist-url=http://gh-contractor-zcbenz.s3.amazonaws.c om/atom-shell/dist" "--arch=x64" "--ensure" "--verbose" "--proxy=https://me:my_passwort@proxyname:port"
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Users\\me\\AppData\\Local\\atom\\app-1.8.0\\resources\\app\\apm\\bin\\node.exe', gyp verb cli   'C:\\Users\\me\\AppData\\Local\\atom\\app-1.8.0\\resources\\app\\apm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'install',
gyp verb cli   '--target=0.36.8',
gyp verb cli   '--dist-url=http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist',
gyp verb cli   '--arch=x64',
gyp verb cli   '--ensure',
gyp verb cli   '--verbose',
gyp verb cli   '--proxy=https://me:my_password@proxyname:port' ]
gyp info using node-gyp@2.0.2
gyp info using node@0.10.40 | win32 | ia32
gyp verb command install []
gyp verb install input version string "0.36.8"
gyp verb install installing version: 0.36.8
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 0.36.8
gyp verb ensuring nodedir is created C:\Users\me\.atom\.node-gyp\.node-gyp\0.36.8
gyp verb created nodedir C:\Users\me\.atom\.node-gyp\.node-gyp\0.36.8
gyp http GET http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist/v0.36.8/node-v0.36.8.tar.gz
gyp verb download using proxy url: "https://me:my_password@proxyname:port"
gyp WARN install got an error, rolling back install
gyp verb command remove [ '0.36.8' ]
gyp verb remove using node-gyp dir: C:\Users\me\.atom\.node-gyp\.node-gyp
gyp verb remove removing target version: 0.36.8
gyp verb remove removing development files for version: 0.36.8
gyp ERR! install error
gyp ERR! stack Error: 9684:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:782:
gyp ERR! stack
gyp ERR! stack     at SlabBuffer.use (tls.js:235:18)
gyp ERR! stack     at CleartextStream.read [as _read] (tls.js:455:29)
gyp ERR! stack     at CleartextStream.Readable.read (_stream_readable.js:341:10)
gyp ERR! stack     at EncryptedStream.write [as _write] (tls.js:369:25)
gyp ERR! stack     at doWrite (_stream_writable.js:226:10)
gyp ERR! stack     at writeOrBuffer (_stream_writable.js:216:5)
gyp ERR! stack     at EncryptedStream.Writable.write (_stream_writable.js:183:11)
gyp ERR! stack     at write (_stream_readable.js:602:24)
gyp ERR! stack     at flow (_stream_readable.js:611:7)
gyp ERR! stack     at Socket.pipeOnReadable (_stream_readable.js:643:5)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Users\\me\\AppData\\Local\\atom\\app-1.8.0\\resources\\app\\apm\\bin\\node.exe" "C:\\Users\\me\\AppData\\Local\\atom\\app-1.8.0\\resources\\app\\apm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "install" "--target=0.36.8" "--dist-url=http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist" "--arch=x64" "--ensure" "--verbose" "--proxy=https://me:my_password@proxyname:port"
gyp ERR! cwd C:\Users\me
gyp ERR! node -v v0.10.40
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok

pay attention to this two lines:

gyp ERR! stack Error: 9684:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:782:

My System:

  • Windows 7 64bit
  • Atom installed from just downloaded AtomSetup.exe
$ apm --version
apm  1.9.2
npm  2.13.3
node 0.10.40
python 2.7.12
git 2.8.1.windows.1
visual studio

I give up! For me that was sooooo wasted time!

Hope at least this will help to save somebodys time!

Have a nice day 🌴 🌴 🌴

@Tset-Noitamotua
Copy link

last thought:

May several node installation conflict here? Just ask cause it seems that I have more than one version installed:

$ apm --version
apm  1.9.2
npm  2.13.3
node 0.10.40
python 2.7.12
git 2.8.1.windows.1
visual studio

$ npm --version
2.7.4

$ node --version
v0.12.2

@falms
Copy link

falms commented Jul 19, 2016

@Tset-Noitamotua See also: #322 (comment)

gyp verb download using proxy url: "https://me:my_password@proxyname:port"

Where did you set this variable? Please check carefully and replace https with http.

@Tset-Noitamotua
Copy link

@falms
Oh no ... you are kidding me, man!!! I cant believe it, that one f****ng s shit up my entire morning and THE solution is hidden in a tiny one-liner???

Can we highlight it somehow and make it flash and blink and let make some noise ;-)

Where did you set this variable?

--> Everywhere ... as my understanding of our proxy always was that it can be accessed through https://... only - and thus i did in any other application I used before in my life .. and it worked.

@JulienGrv
Copy link

If there is a backslash somewhere in your address, use the html code %5C. Example:
proxy=http://domain%5Cusername:password@proxy:port
Please note that only the options proxy and https-proxy are available, http-proxy doesn't exist.

@doshiv
Copy link

doshiv commented Mar 15, 2017

I was getting the same errors as described above, as I am behind a company proxy.

What i did not do:
I did not specify the proxy settings in my apm config.

What I did on Linux?
Open up Firefox browser and navigate to a page on the internet by entering my username/password single sign on details ( as provided by my company) and then re-executed the command:
$apm install
and boom, it worked!

@az-z
Copy link

az-z commented Mar 15, 2017

i'm on RH 7.3.
This is what worked for me:

`
apm -v
apm 1.15.3
npm 3.10.5
node 4.4.5 x64
python 2.7.5
git 1.8.3.1

[andrew@rpm-dev Pic]$
[andrew@rpm-dev Pic]$ apm config list
; cli configs
globalconfig = "/home/andrew/.atom/.apm/.apmrc"
user-agent = "npm/3.10.5 node/v4.4.5 linux x64"
userconfig = "/home/andrew/.atom/.apmrc"

; environment configs
node-gyp = "/usr/share/atom/resources/app/apm/bin/../node_modules/.bin/node-gyp"

; userconfig /home/andrew/.atom/.apmrc
proxy = "http://<user>:<pass>@<IP>:<port>/"
strict-ssl = false

; globalconfig /home/andrew/.atom/.apm/.apmrc
cache = "/home/andrew/.atom/.apm"
progress = false

; node bin location = /usr/share/atom/resources/app/apm/bin/node
; cwd = /home/andrew/work/GoLang/src/github.com/az-z/lab-go/Pic
; HOME = /home/andrew/.atom/.node-gyp
; "npm config ls -l" to show all defaults.
`

it was important to add ssl and remove htt{p,s}-proxy variables from the config file. I do have HTT{P,S}_PROXY variables in the env.

@rajasimon
Copy link

My atom working behind proxy when I setup https-proxy with http://ip:port not https://:ip:port

The README is wrong may be I think

@HustLion
Copy link

apm config set https-proxy http://127.0.0.1:9743 this works on macOS Sierra.

@shanepadgett
Copy link

@davelander What if the password contains an '@' symbol?

@JonasSaegesser
Copy link

JonasSaegesser commented Oct 11, 2017

If I try to install a package i get the following error:

apm install emmet --verbose
.........
REQUEST { url: 'https://atom.io/api/packages/emmet',
json: true,
retries: 4,
proxy: 'http://1.2.3.4:1234/',
strictSSL: false,
headers: { 'User-Agent': 'npm/3.10.10 node/v6.9.5 win32 x64' },
callback: [Function],
method: 'GET' }
REQUEST make request https://atom.io/api/packages/emmet
failed
Request for package information failed: tunneling socket could not be established, statusCode=407 (5 attempts) (ECONNRESET)

My apm config ls output:

; cli configs
globalconfig = "C:\Users\me\.atom\.apm\.apmrc"
user-agent = "npm/3.10.10 node/v6.9.5 win32 x64"
userconfig = "C:\Users\me\.atom\.apmrc"

; environment configs
node-gyp = "C:\Users\me\AppData\Local\atom\app-1.21.0\resources\app\apm\bin\\..\node_modules\node-gyp\bin\node-gyp.js"

; userconfig C:\Users\me.atom.apmrc
http-proxy = "http://1.2.3.4:1234"
https-proxy = "http://1.2.3.4:1234/"
proxy = "http://1.2.3.4:1234/"
strict-ssl = false

; globalconfig C:\Users\me.atom.apm.apmrc
cache = "C:\Users\me\.atom\.apm"
progress = false

; node bin location = C:\Users\me\AppData\Local\atom\app-1.21.0\resources\app\apm\bin\node.exe
; cwd = C:\Users\me\AppData\Local\atom\app-1.21.0\resources\app\apm\bin
; HOME = C:\Users\me
; "npm config ls -l" to show all defaults.`

What i find strange is the / after the https-proxy and the proxy port. Therefor I checked my .apmrc file again. This should be fine:

http-proxy=http://1.2.3.4:1234
https-proxy=http://1.2.3.4:1234
proxy=http://1.2.3.4:1234
strict-ssl=false

The only thing I can think of is that the / behind the port could be an issue.. But I have no idea how to remove it.

Any ideas?

Cheers
Jonas

@divyranjan17
Copy link

@davelander 's solution works perfectly fine.

@ModiGit
Copy link

ModiGit commented Jan 6, 2020

This worked for me on ubuntu 16.04 behind corporate proxy. It doesn't make sense to me but I decided to give it a shot and it worked :S.

apm config set https-proxy http://127.0.0.1:9743 this works on macOS Sierra.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests