How to specify a user id and password for Visual Studio Code with an authenticating proxy?

Set credentials inside the proxy url:

http://username:[email protected]:5187/

WARNING: Setting your password in plaintext in a file can easily lead to your account being compromised. Further it might violate your companies data security guidelines. https://cwe.mitre.org/data/definitions/256.html


If you don't want to store your credentials in the settings file, fiddler can be used to proxy the call to the proxy. Furthermore, I believe the above only works for proxy servers using basic authentication, the following should work for NTLM.

VSCode Open Settings File:

%APPDATA%\Code\User\settings.json

add the following:

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

Fiddler Confirm fiddler settings:

enter image description here enter image description here

Fiddler Ensure Fiddler set to automatically authenticate:

enter image description here

VSCode Extensions should now be online:

enter image description here


Update

This is now no longer required following implementation of PR #22369 which was implemented in version 1.15 Proxy server authentication.

In my case I still needed to add:

"http.proxyStrictSSL": false

My favorite response here is David Martin's suggestion of using Fiddler. But in case that is not something you want to undertake, below is how to set your credentials for the proxy.

To specify DOMAIN + username + password: (It will likely not work with a slash, so use %5C in the place of the slash as shown below)

// The proxy setting to use. If not set will be taken from the http_proxy and https_proxy environment variables
"http.proxy": "http://DOMAIN%5Cusername:password@proxy_name_or_ip:port",
"https.proxy": "http://DOMAIN%5Cusername:password@proxy_name_or_ip:port",

// Whether the proxy server certificate should be verified against the list of supplied CAs.
"http.proxyStrictSSL": false,

To specify just username + password:

// The proxy setting to use. If not set will be taken from the http_proxy and https_proxy environment variables
"http.proxy": "http://username:password@proxy_name_or_ip:port",
"https.proxy": "http://username:password@proxy_name_or_ip:port",

// Whether the proxy server certificate should be verified against the list of supplied CAs.
"http.proxyStrictSSL": false,