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

Install extension with HTTP Proxy with Basic authentification not working #4003

Closed
ovidiubuligan opened this issue Mar 11, 2016 · 24 comments
Closed
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@ovidiubuligan
Copy link

Hello,
trying to use proxy settings with basic authentification http://user1:mypa$$1@proxy1.company.com:3128 results in errors .

Looking into dev tools I see entries similar to this one:

connect EAFNOSUPPORT 10.0.1.1:3128 - Local (undefined:undefined): Error: connect EAFNOSUPPORT 10.0.1.1:3128 - Local (undefined:undefined)
    at Object.exports._errnoException (util.js:837:11)
    at exports._exceptionWithHostPort (util.js:860:20)
    at connect (net.js:838:14)
    at net.js:981:7
    at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:10)e.onUnexpectedError @ /C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:113
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:27 WARNING: Promise with no error callback:7

other programs that use http_proxy/https_proxy environment variables work with the current env settings(ex curl).
Does someone have a clue?

@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?

If not, you might need to url escape your username / password.

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Mar 11, 2016
@ovidiubuligan
Copy link
Author

I have node 4.3.1 in windows 7 with vs code 10.10 and I get :

Url {
  protocol: 'http:',
  slashes: true,
  auth: 'user1:pa$$1',
  host: 'proxyhost.company.com:3128',
  port: '3128',
  hostname: 'proxyhost.company.com',
  hash: null,
  search: null,
  query: null,
  pathname: '/',
  path: '/',
  href: 'http://user1:pa%24%241@proxyhost.company.com:3128/' }

I have
Also running with code 10,08 same problem .

@joaomoreno
Copy link
Member

Is there any functionality that seems broken? Can you for example install extensions?

@ovidiubuligan
Copy link
Author

That is where I get the error , trying to install an extension , in the autocomplete listing.
I also have multiple network interfaces from vagrant and OpenVPN . I have no ideea where to start looking at.

I also have another funky network related application: http://widecap.com/ , It can make any application proxyfiable even if it doesn't support poroxying .I use it for apps that don't support proxying.I also tried widecap on vscode without proxy ... but I got some other errors in the console.

@joaomoreno
Copy link
Member

The error code EAFNOSUPPORT is what gets me worried. There's something about your system that doesn't let Code talk to 10.0.1.1:3128, which looks like a decently normal IPv4 address to me.

Is 10.0.1.1 your proxy?

@ovidiubuligan
Copy link
Author

Ns lookup on the proxy host gives me 10.0.1.1.

I tried again with *_widecap *_software and the error I get is :

connect EAFNOSUPPORT **1.0.0.1:443** - Local (undefined:undefined): Error: connect EAFNOSUPPORT 1.0.0.1:443 - Local (undefined:undefined)
    at Object.exports._errnoException (util.js:837:11)
    at exports._exceptionWithHostPort (util.js:860:20)
    at connect (net.js:838:14)
    at net.js:981:7
    at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:10)

Which gives me some wierd IP address 1.0.0.1:443.
I also have :"http.proxyStrictSSL": false in vscode user settings

@joaomoreno
Copy link
Member

This is really strange.

Can you run this simple NodeJS script by putting in script.js and running node script.js from the Command Prompt?

http.get('http://www.google.com/index.html', (res) => {
  console.log(`Got response: ${res.statusCode}`);
  // consume response body
  res.resume();
}).on('error', (e) => {
  console.log(`Got error: ${e.message}`);
});

What do you get from it?

@ovidiubuligan
Copy link
Author

node doesn't seam to use proxy settings from environment variables. I get:

c:\PRJ\Temp>node script.js
Got error: getaddrinfo EAI_AGAIN www.google.com:80

@joaomoreno
Copy link
Member

EAI_AGAIN is also not an error related to proxying... Try that snippet again later.

@ovidiubuligan
Copy link
Author

nslookup command doesn't work at all also

C:\Users\myuser>nslookup google.com
Server:  internalhost.company.com
Address:  10.169.96.251

*** internalhost.company.com can't find google.com: Server failed

Other programs after I set them to use a proxy they work also solving dns queries through proxies.
Can this be a issue with vscode ?

@joaomoreno
Copy link
Member

Not sure, since Code appears to try to reach your proxy 10.0.1.1:3128 but fails in doing so. Something is definitely up.

Can you try the Atom editor, which also has a proxy setting?

@ovidiubuligan
Copy link
Author

Hello, sorry for the late reply,
After Atom testing I got the same behavior I think:
look

Fetching featured packages failed.Hide output…
tunneling socket could not be established, cause=getaddrinfo ENOTFOUND

I also urlencoded the password and @ symbol for passwords.
There is no error in the Dev tools console (unlike Vscode).
I am not really sure if I placed the settings in the right config file location.
Setting http-proxy strict-ssl in the http the ~\.atom\.apm\.apmrc seams to resset to default almost empty file after I restart atom.
I copyied .apmrc up one level since I have read somewhere that there it should be , so I have ~\.atom\.apmrc. and the settings seam to stay there and the error (first image) is shown.

Deleting the proxy configuration from ~\.atom\.apmrc gives me a different error shown bellow:
look2

Fetching featured packages failed.Hide output…
tunneling socket could not be established, cause=connect EAFNOSUPPORT

So a different error message meaning that proxy setting is somehow taken into account.
Do you have any suggestions on what to try next

@joaomoreno
Copy link
Member

I am really not sure. It doesn't look proxy related but rather a problem with your system's configuration.

Seems like the guys at nodejs/node would be able to help you out. Just describe what you described here.

@ovidiubuligan
Copy link
Author

ovidiubuligan commented Apr 15, 2016

Hello, sorry for commenting on a closed issue. I just want to try an extra scenario.
It is most probably related to : nodejs/node#1490 , To also tunnel DNS requests through proxy.

Can I store dc.services.visualstudio.com and vortex.data.microsoft.com ip addresses
in the config next to the proxy settings somehow ,similar co etc/hosts , but without modifying windows etc/hosts ?

@joaomoreno
Copy link
Member

What do you mean by store? What do you intend to accomplish?

@ovidiubuligan
Copy link
Author

ovidiubuligan commented Apr 15, 2016

I updated the comment. I meant something like :

dns : {
  "dc.services.visualstudio.com" : "40.114.241.141",
  "vortex.data.microsoft.com": "191.232.139.254"
}

And use somehow those ip's ... but this is again an aspect of node js. But maybe there is some way .

Edit:
I just tried adding the mappings to windows etc/hosts file and I get:

Error: connect EAFNOSUPPORT 191.232.139.254:443 - Local (undefined:undefined) at Object.exports._errnoException (util.js:837:11) at exports._exceptionWithHostPort (util.js:860:20) at connect (net.js:838:14) at net.js:981:7 at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:10)
address: "191.232.139.254"
code: "EAFNOSUPPORT"
errno: "EAFNOSUPPORT"
message: "connect EAFNOSUPPORT 191.232.139.254:443 - Local (undefined:undefined)"

@joaomoreno
Copy link
Member

So what do you get when running this in the command line?

node -e "require('dns').resolve4('dc.services.visualstudio.com', (err, result) => console.log(err, result))"

@ovidiubuligan
Copy link
Author

I get :

{ [Error: queryA ESERVFAIL dc.services.visualstudio.com]
  code: 'ESERVFAIL',
  errno: 'ESERVFAIL',
  syscall: 'queryA',
  hostname: 'dc.services.visualstudio.com' } undefined

I get this regardless of etc/hosts ip mappings . (I tried with mappings and without mappings)

@joaomoreno
Copy link
Member

How about:

node -p "require('dns').getServers()"

@joaomoreno
Copy link
Member

And also:

node -e "require('dns').lookup('dc.services.visualstudio.com', (err, result) => console.log(err, result))"

@ovidiubuligan
Copy link
Author

I get this (I think it is safe to show them) :

[ '10.8.68.251',
  '10.8.132.253',
  'fec0:0:0:ffff::1',
  '10.169.96.251',
  '10.8.132.253',
  '10.169.96.251',
  '10.8.132.253',
  'fec0:0:0:ffff::1',
  '10.169.96.251',
  '10.8.132.253' ]

@joaomoreno
Copy link
Member

How about the last snippet?

@ovidiubuligan
Copy link
Author

Last snippet : node -e "require('dns').lookup('dc.services.visualstudio.com', (err, result) => console.log(err, result))"
returns :

{ [Error: getaddrinfo EAI_AGAIN]
  code: 'EAI_AGAIN',
  errno: 'EAI_AGAIN',
  syscall: 'getaddrinfo',
  hostname: 'dc.services.visualstudio.com' } undefined

(I have no ip mappings in etc/hosts)

@ovidiubuligan
Copy link
Author

It works now. It was a problem with an "WideCap" proxyfier app i had installed . Which made this and some other software (office) not work .

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants