0

My Setup

Mac osx : Catalina 10.15.5

VS code

Version: 1.51.0
Commit: fcac248b077b55bae4ba5bab613fd6e9156c2f0c
Date: 2020-11-05T18:14:40.758Z (4 days ago)
Electron: 9.3.3
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 19.5.0

My Problem

I cannot connect to Extensions market place using vscode, here is the error message

If I open developer tools (F1 > Toggle Developer Tools) and inspect the request to marketplace it says net::ERR_ACCESS_DENIED

But I can copy out that request as curl (right click -> copy and curl) and it works fine from my terminal

curl 'https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery' \
  -H 'X-Market-User-Id: f8427084-f361-48f0-b662-fabf315667cf' \
  -H 'Accept: application/json;api-version=3.0-preview.1' \
  -H 'Referer: ' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.51.0 Chrome/83.0.4103.122 Electron/9.3.3 Safari/537.36' \
  -H 'X-Market-Client-Id: VSCode 1.51.0' \
  -H 'Content-Type: application/json' \
  --data-binary '{"filters":[{"criteria":[{"filterType":8,"value":"Microsoft.VisualStudio.Code"},{"filterType":10,"value":"py"},{"filterType":12,"value":"4096"}],"pageNumber":1,"pageSize":50,"sortBy":0,"sortOrder":0}],"assetTypes":[],"flags":946}' \
  --compressed

Also if I open (F1 > Toggle Developer Tools) and go to the console tab and try to do any other fetch e.g await fetch("https://randomuser.me/api/") then I get the same error (so it looks like my vscode is having a problem connecting to the internet in general)

Things that didn't work:

Workaround:

Using the VScode insider build works fine, I can search and install extensions no problem (https://code.visualstudio.com/insiders/)

Any help greatly appreciated.

Thanks

Simon Verhoeven
  • 347
  • 4
  • 16

1 Answers1

0

I fix this question by change the http proxy, you can open the vscode setting page and search 'proxy', change the Http:proxy to your proxy or not set, and then test hope helpful to you:)