Skip to content

"self signed certificate in certificate chain" while attempting to install an extension via command line #144625

Closed as not planned

Description

@yorkish

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.6.5
  • OS Version: Rocky Linux 8.5

Steps to Reproduce:

  1. Adding company's certificates under/etc/pki/ca-trust/source/anchors
  2. execute update-ca-trust
  3. every program accessing the internet is working fine
  4. Install VS Code
  5. execute VSCode and install an extension succesfully
  6. exit VSCode
  7. open command line
  8. run this command : code --install-extension MS-CEINTL.vscode-language-pack-fr
  9. get the message : self signed certificate in certificate chain

Seems that using the cli, the system certificates are ignored.

Activity

  1. added
    info-needed
    on Mar 8, 2022
  2. yorkish commented on Mar 8, 2022

    @yorkish
    Author

    I'm using npm on the same machine.
    I'm also aware that node.js / npm is not using the certs installed in the OS, but uses the default Mozilla certs.
    I've set the cafile config in npm from day one and that works fine!

    so I went on and commented out the cafile and ran that command :

    export NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-bundle.crt

    sure it adds every single root certificates from the OS, but for testing purpose....
    so the environment variable gets picked up by node.js and npm ci works like a charm.

    I get back to code in that same terminal,
    ran printenv,
    confirmed that I see that variable NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-bundle.crt

    same outcome
    may I stress out that installing an extension in the GUI works fine

  3. joaomoreno commented on Mar 9, 2022

    @joaomoreno
    Contributor

    Any thoughts Robo (@deepak1556)?

  4. deepak1556 commented on Mar 9, 2022

    @deepak1556
    Collaborator

    This should be addressed by nodejs/node@30e878b that avoids respecting the NODE_EXTRA_CA_CERTS for the electron runtime.

    yorkish can you try the following exploration build that contains the above fix and see if it helps, thanks!

  5. added
    electron
    linux
    network
    upstream
    on Mar 9, 2022
  6. yorkish commented on Mar 9, 2022

    @yorkish
    Author

    I tried the latest exploration build coming in from the official repo. Looking at the build timestamp, it's more recent.
    did not work.
    full log of what I tried is attached
    log.txt

  7. yorkish commented on Apr 4, 2022

    @yorkish
    Author

    any news on that issue ?
    tried it unsuccessfully on v1.66

    couldn't you guys add a cert bypass (command-line argument) only valid on an install extension via command-line?

  8. ondraco commented on Apr 12, 2022

    @ondraco

    I have the same issue when installing extensions in WSL.
    When I do it via UI it works but if I use CLI I get the self signed certificate in certificate chain error.
    Only temp workaround I found so far is to do
    export NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt

  9. yorkish commented on Apr 13, 2022

    @yorkish
    Author

    ondraco this it what I tried already, and it doesn't work on Rocky Linux

  10. vscodenpa commented on Jul 11, 2022

    @vscodenpa

    Hey Robo (@deepak1556), this issue might need further attention.

    yorkish, you can help us out by closing this issue if the problem no longer exists, or adding more information.

  11. MaxwellBanks commented on Jul 13, 2022

    @MaxwellBanks

    Running on Ubuntu 20.04 with VSCode version 1.69.1, I'm having the same issue I believe. Additionally, I tried the following workaround:

    code --install-extension MS-CEINTL.vscode-language-pack-fr --ignore-certificate-errors
    

    With no luck.
    Seconding the request for a cert bypass feature for CLI extension installs, if at all possible.

  12. MaxwellBanks commented on Jul 13, 2022

    @MaxwellBanks

    For anyone who may come across this, I found a rather questionable workaroud for the time being (this will overwrite your settings.json, so be careful!):

    echo '{"http.proxyStrictSSL": false}' > /path/to/your/settings.json
    code --install-extension <your-extension> --force
    echo '' > /path/to/your/settings.json
    

    Make sure you no longer have "http.proxyStrictSSL": false in your settings.json after the fact!

    Still hoping for a built-in cert bypass, but this works in the meantime.

  13. vscodenpa commented on Oct 2, 2022

    @vscodenpa

    Hey Robo (@deepak1556), this issue might need further attention.

    yorkish, you can help us out by closing this issue if the problem no longer exists, or adding more information.

  14. vscodenpa commented on Oct 10, 2022

    @vscodenpa

    This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

    Happy Coding!

  15. locked and limited conversation to collaborators on Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

electroninfo-neededlinuxnetworkupstream

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions