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.
4
Answers
I solved this error:
check_certificate = off
Results:
solved this by adding the update.code.visualstudio.com domain to the trusted list in kaspersky:
After hours of research I came with a more secure and efficient solution:
Open Control Panel, then Internet Options, go to the Content tab and click Certificates.
Go to the Trusted Root Certificate Authorities tab, select the Kaspersky root certificate and click Export.
Follow the instructions. Use the default settings during the certificate export. Enter the name kaspersky.cer for the file.
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
Copy the created .crt file to
/usr/local/share/ca-certificates/
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.