Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy support for extension gallery #69

Closed
diegovilar opened this issue Nov 18, 2015 · 118 comments · Fixed by #186
Closed

Proxy support for extension gallery #69

diegovilar opened this issue Nov 18, 2015 · 118 comments · Fixed by #186
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority on-testplan verified Verification succeeded
Milestone

Comments

@diegovilar
Copy link

Whenever I try to install any extension, using ext install, I get a connect ETIMEDOUT 191.238.172.191:443 error.

Trying to navigate to https://191.238.172.191 in the browser produces a warning regarding the certificate being valid only for *.market.visualstudio.com, but I'm allowed to proceed.

Shouldn't VSCode try to connect to the name instead of the IP?

I'm behind a proxy, VSCode updates just fine behind it, and also lists the available extensions. The firewall here logs the invalid certificate but allows the connection to proceed. Doesn't look like a problem in my end...

OS: Windows 7
VSCode: 0.10.1

@RefractedPaladin
Copy link

I'm getting nearly the same thing although it never lists the available extensions for me. I get a "self signed certificate in certificate chain" error but I believe it is related to this issue as the rest is the same as well.

OS: Windows 8.1
VSCode: 0.10.1

@pedrosousa
Copy link

Currently using ZScaler as (company) proxy. It usually needs its own certificate (acting as a MITM) to be considered in order not to have the following error: "unable to get local issuer certificate".
There should be either a "valid certificates" configuration (accepting a folder or a file path) or a "do not validate the certificate chain" boolean setting.

@CL0SeY
Copy link

CL0SeY commented Nov 19, 2015

It seems like vscode is ignoring the "http.proxy" configuration when downloading extensions. For me, it works fine when listing extensions.

So, it's getting the IP resolved and connecting directly, rather than using a proxy.

@itbaby
Copy link

itbaby commented Nov 19, 2015

yeah, I met the same issue.

@blastmann
Copy link

same issue here, can't install extensions~

@joaomoreno joaomoreno changed the title Getting "connect ETIMEDOUT 191.238.172.191:443" when trying to install extensions Proxy support for extension gallery Nov 19, 2015
joaomoreno added a commit that referenced this issue Nov 19, 2015
@joaomoreno joaomoreno added this to the Nov 2015 - Recovery milestone Nov 19, 2015
@bpasero
Copy link
Member

bpasero commented Nov 19, 2015

Not yet fixed.

@bpasero bpasero reopened this Nov 19, 2015
@bpasero bpasero removed this from the Nov 2015 - Recovery milestone Nov 19, 2015
@bpasero bpasero assigned bpasero and unassigned joaomoreno Nov 19, 2015
@bpasero bpasero added this to the Dec 2015 milestone Nov 19, 2015
@iamzhout
Copy link

suggest to reference atom's implementation, by using strict-ssl = false
https://atom.io/docs/v1.0.0/getting-started-installing-atom#setting-up-a-proxy

@sparty02
Copy link

@bpasero Out of curiosity, is there a general timeframe for releasing changes merged into master?

@joaomoreno
Copy link
Member

Like always, we will maintain a monthly release cadence. There are plans to get an unstable update channel out there, but this might take a while.

@sparty02
Copy link

Thanks for the info!

@KindDragon
Copy link
Contributor

@bpasero Will it works with MS NTLM proxy?

@bpasero
Copy link
Member

bpasero commented Nov 23, 2015

Not sure, @aeschli can you comment, it uses your proxy work.

@aeschli
Copy link
Contributor

aeschli commented Nov 23, 2015

Sorry I don't know how MS NTLM is related to HTTP proxies. Do you have more information, @KindDragon ?

@joaomoreno
Copy link
Member

What do you get if you run node and in its interactive prompt run require('url').parse('YOUR PROXY URL')?

Namely, do the host and auth parameters look OK to you?

@kikokikok
Copy link

that's exactly what I tracked down while I was debugging, the parsing has something wrong and you're right i tracked it down to the https-proxy module which leverages on the node url parser.
the data is totally messed up.

I Managed to track it down to the presence of a '#' character in my password. might be worth url-encoding the content maybe

@joaomoreno
Copy link
Member

Good catch. You should url encode the password before putting it in a url yeah.

@xaqfox
Copy link

xaqfox commented Feb 18, 2016

I'm running CNTLM with Code 0.10.8 and resolved this error by adding the protocol to the http.proxy preference.

I was attempting with "http.proxy": "localhost:3128" and I changed it to "https://localhost:3128" to get it working.

Parsing the old URL in node's interactive console gave the following output, which put me on the right track (thanks!):

require('url').parse('localhost:3128')
Url {
protocol: 'localhost:',
slashes: null,
auth: null,
host: '3128',
port: null,
hostname: '3128',
hash: null,
search: null,
query: null,
pathname: null,
path: null,
href: 'localhost:3128' }

@mponton
Copy link

mponton commented Feb 18, 2016

@xaqfox Wow man, this fixed the issue on my side. I bit sad that different projects need different a syntax for http_proxy (that said I can't believe I did not try that syntax myself). Thanks for the tip! (Still not sure why I could not see any traffic in the first place but hey, I got other things to take care of).

@schwarzie2478
Copy link

I finally found all the pieces needed for a complete solution working behind a corporate proxy on Windows:

I use fidller as authentication proxy ( no need to set fiddler as system proxy replacement)

Set environment variables: (also usefull for other tools)
_JAVA_OPTIONS=-Dhttp.proxyHost="localhost" -Dhttp.proxyPort="8888" -Dhttps.proxyHost="localhost" -Dhttps.proxyPort="8888"
HTTP_PROXY : 127.0.0.1:8888
HTTPS_PROXY : 127.0.0.1:8888

for SSL certificate problem:

create a .coderc file in your user dir
with contents:

strict-ssl=false

I also added it to the user settings file but that didn't help with the extentions

Make sure you have updated to version 0.10.8 to have the fix for installing extentions

@KindDragon
Copy link
Contributor

Hi,
I've been able to identify an unresolved issue that might help solving the issue.
when setting
"http.proxy": "http://[user]:[password]@[url]:8080",
"http.proxyStrictSSL": false

It doesn't work for the following reason:
workbench.main.js:87 getaddrinfo ENOTFOUND [user] [user]:80: Error: getaddrinfo ENOTFOUND [user] [user]:80
at errnoException (dns.js:25:10)
at GetAddrInfoReqWrap.onlookup as oncomplete

Our corporate proxy is NTLM based and can leverage on declarative authentication in the Proxy Url

Seems like the parsing of the username and password is bugged,

It's work for me we %5С as delimiter between domain and login in username: http://superuser.com/a/395177/64719

"http.proxy": "http://DOMAIN%5CUSERNAME:PASSWORD@PROXYIP:PROXYPORT"

@kylewolfe
Copy link

I'm also having issues behind an NTLM proxy. I do not have any special characters in my password. I often do not get an error, but the list never loads. On v0.10.8.

@joaomoreno
Copy link
Member

@kylewolfe What do you get if you run node and in its interactive prompt run require('url').parse('YOUR PROXY URL')?

Namely, do the host and auth parameters look OK to you?

@KindDragon
Copy link
Contributor

I'm also having issues behind an NTLM proxy. I do not have any special characters in my password. I often do not get an error, but the list never loads. On v0.10.8.

Try to specify the username with your domain

@ZodmanPerth
Copy link

Just getting back to trying to resolve my particular issue again. Installing v0.10.11 and adding "http://" to my http.proxy URL fixes my issue accessing the extensions list for browsing.

Interestingly though, the traffic still doesn't show up on my Fiddler4 session.

@KushagraGitter
Copy link

put below lines in file setting.json
"http.proxy": "http://yourproxy.com:8080",
"https.proxy":"https://yourproxy.com:8080"

@Barryrowe
Copy link

This was working with @joaomoreno 's fix a long time ago, but something broke it again along the way, and seems to be worse. Through an NTLM negotiated proxy, none of these work-arounds seem to work. I'm on Windows 7, VSCode Insiders v1.0.1-insider.

I have the following set (and have tried with/without each of them):

  "http.proxy": "http://myproxyhost:11111",
  "https.proxy": "http://myproxyhost:11111",
  "http.proxyStrictSSL": false

Extensions never list when using ext install, and the bar just disappears. No error message like before.

@ranjith86
Copy link

@Barryrowe I have the same issue using VSCode Insiders. Which file do you have these settings?

@joaomoreno
Copy link
Member

@Barryrowe @ranjith86 Can you test with the latest stable 1.0.0 and let me know if it is broken there as well?

@Barryrowe
Copy link

@ranjith86 they are in my settings.json
It looks like this is an ongoing issue and being worked on #5596

@joaomoreno I will check, and move discussion to the open issue

@joaomoreno
Copy link
Member

Just reply here.

@ranjith86
Copy link

@joaomoreno for what ever reason, I can't open VS code on my machine. Only VSCode Insiders works. My settings.json file is as below, it is currently in my project folder.... is that right location?

{
  "http.proxy": "http://localhost:8888",
  "https.proxy": "http://localhost:8888",
  "http.proxyStrictSSL": false
}

@joaomoreno
Copy link
Member

joaomoreno commented Apr 26, 2016

The right location can be found with:

image

@ranjith86
Copy link

@joaomoreno thanks, that worked. The location of settings.json was wrong in my case.

@Barryrowe
Copy link

I'm getting similar behavior in stable v1.0.0. The difference is that the blue loading bar doesn't scroll across the bottom of the console input. It still just disappears without an error message.

if I completely remove the http.* settings, the blue loading bar shows, and I do get a ETIMEDOUT error. So it seems the VS code is talking to the proxy when configured, but the response might be empty for some reason coming back.

@joaomoreno
Copy link
Member

joaomoreno commented Apr 26, 2016

Alright, that sounds like #5596 then. Any chance I can use your proxy, btw?

@woei66
Copy link

woei66 commented May 10, 2016

I had the same issue and added below lines to fix the problem
{
"http.proxyStrictSSL": false,
"http.proxy": "http://company-proxy.com:8080",
"https.proxy":"https://company-proxy.com:8080"
}

@tebeco
Copy link

tebeco commented May 24, 2016

Hi, it seems I missed something :

Here is my configuration (Domain / User / Pass are Url Encoded in the following pictures)
image
image

DevTools :
image

I've even tried to run "code" from a prompt command after a couple of :
SET HTTP_PROXY="...."
SET HTTPS_PROXY="...."

I've also tried http/https on my proxy scheme to be sure, and also with or without the encoded Domain / user / pass
The result is always the same ==> HTTP 407 (Proxy Authentication Required).

CNTLM is definitly NOT an option for multiple good reasons that i won't discuss here. I'd like to solve this issue within VsCode configuration

FYI : Visual Studio 2013 / 2015 / dotnet.exe (via command line) / npm / ... WORKS with the proxy perfectly and the URI : https://api.nuget.org/v3/index.json is also accessible from the network here

@joaomoreno
Copy link
Member

You should check with your proxy administrator to know how authentication should happen. Usually the http://user:password@host:port/ scheme works.

@tebeco
Copy link

tebeco commented May 25, 2016

You're right, VsCode seems to work since this morning. I changed my password there was probably some network cache issue...
I've got access to the Store Extension

Still I encounter something funny :
On the computer I got vs2013.5 vs2015.2, vsCode (latest rtm)
I've installed the .NetCore 1.0.0 Preview 1 (NetCore RC2 + Tooling CLI preview)
online "cli-samples" does not works (some work & some don't)
New templates created from VStudio Works from VS & Command line but not on VsCode
I'm wondering if the issue comes from Nuget/Omnisharp or something else when everything is linked together

As you see in the picture it's attempting to connect to the Project instead of nuget ^^

image

@joaomoreno
Copy link
Member

joaomoreno commented May 25, 2016

That is an issue with either Nuget or the dotnet tooling... I suggest you file an issue to them instead.

@joaomoreno
Copy link
Member

Closing this discussion as everything's been said.

@microsoft microsoft locked and limited conversation to collaborators May 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority on-testplan verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.