huhu_there
huhu_there

Reputation: 125

Update VS Code and Kaspersky certificate

I just wanted to start VS Code on Windows Subsystem Linux but VS Code updates automatically. The issue is a certificate which VS Code wants to access but it is blocked by kaspersky. Kaspersky is installed on Windows 10. I have the Total Securiy Version. Does somebody have a hint? What should I change?

micha@LAPTOP-TD50FJUH:/mnt/c/WINDOWS/system32$ code . Updating VS Code Server to version 8490d3dde47c57ba65ec40dd192d014fd2113496 Removing previous installation... Installing VS Code Server for x64 (8490d3dde47c57ba65ec40dd192d014fd2113496) Downloading: 100% Failed --2021-02-05 18:15:16-- https://update.code.visualstudio.com/commit:8490d3dde47c57ba65ec40dd192d014fd2113496/server-linux-x64/stable Resolving update.code.visualstudio.com (update.code.visualstudio.com)... 51.144.164.215 Connecting to update.code.visualstudio.com (update.code.visualstudio.com)|51.144.164.215|:443... connected. ERROR: cannot verify update.code.visualstudio.com's certificate, issued by ‘CN=Kaspersky Anti-Virus Personal Root Certificate,O=AO Kaspersky Lab’: Self-signed certificate encountered. To connect to update.code.visualstudio.com insecurely, use `--no-check-certificate'. ERROR: Failed to download https://update.code.visualstudio.com/commit:8490d3dde47c57ba65ec40dd192d014fd2113496/server-linux-x64/stable to /home/micha/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496-1612545315.tar.gz Please install missing certificates. Debian/Ubuntu: sudo apt-get install ca-certificates

I have already installed ca-certificates without any Problem.

Upvotes: 10

Views: 7664

Answers (4)

t_r272
t_r272

Reputation: 21

1. go to WSL
then type:
sudo vi /etc/wgetrc
uncomment this line 
#https_proxy = http://proxy.yoyodyne.com:18023/
type:
https_proxy = https://update.code.visualstudio.com/commit:8490d3dde47c57ba65ec40dd192d014fd2113496/server-linux-x64/stable:443/
uncomment 
use_proxy = on
type:
check-certificate=off

Upvotes: 2

Felipe Saldanha
Felipe Saldanha

Reputation: 1345

After hours of research I came with a more secure and efficient solution:

  1. Open Control Panel, then Internet Options, go to the Content tab and click Certificates.

  2. Go to the Trusted Root Certificate Authorities tab, select the Kaspersky root certificate and click Export.

  3. Follow the instructions. Use the default settings during the certificate export. Enter the name kaspersky.cer for the file.

  4. Move the exported .cer file to a Linux folder, open the folder and run this command:

    openssl x509 -inform DER -in kaspersky.cer -out kaspersky.crt

  5. Copy the created .crt file to /usr/local/share/ca-certificates/

  6. Run sudo update-ca-certificates


Sources: this solution is a devolopment from Labradorcode's comment above and was based on a Kaspersky tutorial and this answer.

Upvotes: 5

asouini
asouini

Reputation: 21

solved this by adding the update.code.visualstudio.com domain to the trusted list in kaspersky:

  1. open kaspersky
  2. click on the setting button (the gear at the bottom left)
  3. go to the network setting menu item
  4. add the domain to the trusted adresses

Upvotes: 1

Everton P M A
Everton P M A

Reputation: 197

I solved this error:

  1. (Add Last Line to /etc/wgetrc) - check_certificate = off

Results:

everton@LPEw:/$ code
Updating VS Code Server to version 3c4e3df9e89829dce27b7b5c24508306b151f30d
Removing previous installation...
Installing VS Code Server for x64 (3c4e3df9e89829dce27b7b5c24508306b151f30d)
Downloading: 100%
Unpacking: 100%
Unpacked 1719 files and folders to /home/everton/.vscode-server/bin/3c4e3df9e89829dce27b7b5c24508306b151f30d.
everton@LPEw:/$

Upvotes: 16

Related Questions