Bug #115940 The certificate is not installed at WIN Certificate Store
Submitted: 27 Aug 13:54 Modified: 3 Sep 7:54
Reporter: setra user Email Updates:
Status: Analyzing Impact on me:
None 
Category:Shell VSCode Extension Severity:S1 (Critical)
Version:1.16.1 OS:Windows (windows 11)
Assigned to: Juan Rene Ramirez Monarrez CPU Architecture:x86

[27 Aug 13:54] setra user
Description:
Impossible to use mysql shell for vscode extension, despite trying multiple version of the plugin (i tried multiple time over several month)
i want to use it specifically for MRS
I installed both certificate in the windows certificate store. I tried to installed vscode in the wsl to see if the problem is the same and it is the case. I am not the only one, i updated vc++ (in a previous version of the plugin it tells that it cannot check the certificate store because of this, but vc++ was already installed in the right version and with the latest version 1.16.1 the details disappeared but the result is the same). I have tried to reset extension, uninstall/reinstall vscode, nothing works.

I have no solution or no clue to use this extension, there is a problem with the installation, this is the only extension, i have a problem with in vscode.

etting Python home to 'c:\Users\nicolas1.moreau\.vscode\extensions\oracle.mysql-shell-for-vs-code-1.14.2\shell\lib\Python3.10'
2024-05-17 12:01:58: Info: Loading startup files...
2024-05-17 12:01:58: Info: Loading plugins...
2024-05-17 12:01:59: Info: [MSG] Token read from STDIN
2024-05-17 12:01:59: Info: [MSG] Starting MySQL Shell GUI web server...
2024-05-17 12:01:59: Info: [MSG] 	Checking web server certificate...
2024-05-17 12:02:00: Info: [MSG] The installed certificate has errors: The certificate is not installed at WIN Certificate Store
2024-05-17 12:02:00: Info: [MSG] 	Certificate is not installed. Use gui.core.installShellWebCertificate() to install one.
2024-05-21 11:22:15: Info: c:\Users\nicolas1.moreau\.vscode\extensions\oracle.mysql-shell-for-vs-code-1.14.2\shell\bin\mysqlsh.exe   Ver 8.1.1-g2 for Win64 on x86_64 - for MySQL 8.1.0 (MySQL Community Server (GPL)) - build 12914698 - commit_id 49c753ad55f63fa4f21f0265ce945071ac54b60f
2024-05-21 11:22:15: Info: Using credential store helper: c:\Users\nicolas1.moreau\.vscode\extensions\oracle.mysql-shell-for-vs-code-1.14.2\shell\bin\mysql-secret-store-windows-credential.exe

How to repeat:
i have no clue since some people can use it, i just installed the extension
[28 Aug 16:57] MySQL Verification Team
Hi,

I cannot reproduce this. I tried it with freshly installed windows11 and freshly installed vscode, installed plugin, reboot vscode, click on icon for plugin, next, next, it installed the cert and everything works from there on ... 

Check if you have some problematic certificate installed on your system, for e.g. there are some invalid CA's required in some countries to be installed for their e-gov system that are making python certification libraries to fail and this can show up like problem you are experiencing. Unfortunately only solution is to remove faulty certs from your system.
[29 Aug 9:22] setra user
I am using zscaler root ca (which is more and more used in company), i have found that certificate are not automatically exposed to vs code extension, i installed an extension nammed win-ca but the problem is the same, if it is specific to python, i can try to set the zscaler root ca in the python cert store but i do not know where is the python venv for the extension if there is one or the location of the specific pip needed to install the certificate.
I have no problem with python and zscaler in other way on my windows nor with other vscode extension i used like pylance/python/python debugger/ansible/jinja etc which used python too)
[29 Aug 11:30] Mike Zinner
Hi,

from the error message in the log I can see that the SSL Certificate was not correctly installed on your system for some reason. The reason our VS Code extension needs to install a SSL certificates is because it includes the MySQL Shell binary and communicates with the tool through a web socket connection. VS Code started prohibiting HTTPS connections without a trusted certificate at some point, so the installation of the certificate became mandatory.

Could you please close VS Code, open a terminal window and execute the following commands.

First, we will try to remove any broken certificates.

c:\Users\nicolas1.moreau\.vscode\extensions\oracle.mysql-shell-for-vs-code-1.14.2\shell\bin\mysqlsh.exe --js -e "gui.core.removeShellWebCertificate()"

Then, check if there are even more installed, by running the following.

c:\Users\nicolas1.moreau\.vscode\extensions\oracle.mysql-shell-for-vs-code-1.14.2\shell\bin\mysqlsh.exe --js -e "print(gui.core.isShellWebCertificateInstalled())"

If this function call still returns true, please run the first command until this returns false.

In a final step, we will now install a new certificate with the following command.

c:\Users\nicolas1.moreau\.vscode\extensions\oracle.mysql-shell-for-vs-code-1.14.2\shell\bin\mysqlsh.exe --js -e "gui.core.installShellWebCertificate()"

This should enforce the installation of a new certificate.

Now, if you open VS Code, the MySQL Shell for VS Code extension should start to work normally.

If something does still not work, you still have the option to disable HTTPS and use HTTP instead, by opening the VS Code settings, search for 
    mysql shell https
and then disable both options and restart VS Code. Please note, that this should only be used when you are running VS Code locally.

Thanks,
Mike
[29 Aug 11:34] Mike Zinner
Hi, 

I just noticed that you are still running an old version of the VS Code extension. Please upgrade to v1.16.2 but note that then the PATH of the mysqlsh binary changes, so you will have to update the path used in the commands above from 1.14.2 to 1.16.2 like this:

c:\Users\nicolas1.moreau\.vscode\extensions\oracle.mysql-shell-for-vs-code-1.16.2\shell\bin\mysqlsh.exe --js -e "print(gui.core.isShellWebCertificateInstalled())"

Thanks,
Mike
[3 Sep 7:54] setra user
i have installed the 1.16.2 version, and i have tried your commands, here is the result, this is the same, with administrator privileges or limited account:

 C:\Users\nicolas1.moreau\.vscode\extensions\oracle.mysql-shell-for-vs-code-1.16.2-win32-x64\shell\bin\mysqlsh.exe --js -e "gui.core.removeShellWebCertificate()"
C:\Users\nicolas1.moreau\.vscode\extensions\oracle.mysql-shell-for-vs-code-1.16.2-win32-x64\shell\bin\mysqlsh.exe --js -e "print(gui.core.isShellWebCertificateInstalled())"
false
C:\Users\nicolas1.moreau\.vscode\extensions\oracle.mysql-shell-for-vs-code-1.16.2-win32-x64\shell\bin\mysqlsh.exe --js -e "gui.core.installShellWebCertificate()"
 C:\Users\nicolas1.moreau\.vscode\extensions\oracle.mysql-shell-for-vs-code-1.16.2-win32-x64\shell\bin\mysqlsh.exe --js -e "print(gui.core.isShellWebCertificateInstalled())"
9:49:18.711385 INFO: The installed certificate has errors: The certificate is not installed at WIN Certificate Store
false