Repository: vscode
Issue: Vscode cannot access extensions marketplace when http.proxy contains user credentials
Labels: bug,proxy

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Not applicable, the bug is precisely about extensions

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: Code 1.83.0 (e7e037083ff4455cf320e344325dacb480062c3c, 2023-10-03T16:11:49.843Z)
- OS Version: Linux x64 5.15.0-86-generic snap (Ubuntu 22.04.3 LTS)

I have checked most previously reported issues related to the proxy and extensions (and there are quite a few and mostly a few years old), and although those have been closed/solved, mine is not.

I'm on Ubuntu 22.04.3 LTS.

First of all, there are two separate issues here:
1) How vscode accesses the extensions marketplace for updates/installs
2) How extensions access the Internet

My proxy-related settings are as follows:

```json
{
    "http.proxy": "http://user:password@10.20.30.40:5678/",
    "http.proxySupport": "on",
    "http.proxyAuthorization": null,
    "http.proxyStrictSSL": false,
}
```
With the settings above, vscode cannot access the extensions marketplace. If I remove the `user:password@` part, everything works fine.

**However**, and this is related to the 2nd issue, using this extension: https://marketplace.visualstudio.com/items?itemName=chrmarti.network-proxy-test which I assume tests if extensions can access the Internet, it is the other way around. Without the user credentials, it fails, with them it works.

The environment variables `http_proxy` and `https_proxy` are both set to `http://user:password@10.20.30.40:5678/`.

Please note that I also tried setting `http.proxyAuthorization` to a base64-encoded string of `user:password`, but that didn't work for both scenarios. In this case, I'm also not sure if special characters like `@` which normally have to be url-encoded, as `%40`, need to be encoded here before passed to base64, or there's no need for encoding at all. I think I tried both.

I realize that for the 2nd issue different extensions might use different ways to access the Internet, and some may not work with the proxy settings, but why can't vscode access the extensions marketplace when user credentials are present?

PS. Redirected here from https://github.com/microsoft/vsmarketplace/issues/783 as I thought that this was an issue with the marketplace.