Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How to add a trusted certificate to resolve "Unable to verify the first certificate" error? #233

Open
perryton opened this issue Mar 22, 2022 · 5 comments

Comments

@perryton
Copy link

perryton commented Mar 22, 2022

Describe the bug

Attempting to use the plugin with our hosted version of the IQ server (on our LAN) results in an error about "Nexus IQ extension failure: FetchError: request to ... failed, reason: unable to verify the first certificate."

To Reproduce

Steps to reproduce the behavior:
Just run a scan against our server.

Expected behavior

The server is accepted. I can currently access the server via browser without any certificate warnings/errors.

Desktop (please complete the following information):

OS: Windows 10
NodeJS Version: 14.15.4
VS Code Version: 1.65.2 (user setup)
Version of Extension: 1.2.3

Additional context

On extension version 1.2.3, the "unable to verify the first certificate" error is displayed regardless of whether the Nexus IQ: Strict SSL checkbox is checked or unchecked.

On extension version 0.8.3, the "unable to verify the first certificate" error is displayed only when the Nexus IQ: Strict SSL checkbox is checked. It appears to work properly when it is unchecked.

Questions

  • Is there a trusted certificate store or certificate bundle that the extension uses?
  • Would there be a way for me to add a certificate to that store/bundle, so that I don't encounter the certificate error?
  • Is there a reason why I get the error on the recent extension versions regardless of Strict SSL setting, even though it appears to work with version 0.8.3 when Strict SSL is turned off?

I'm very new to how this extension works, so any help is appreciated. Thanks.

@MananShah9
Copy link

Instead of turning verification off go to the getToken Method in the extension.js file. Add a ca param with the required file.
Even if the solution is jank it is safer than skipping verification.

Hope this helps!🙂

@MananShah9
Copy link

I updated the code to support custom CA file selection but unfortunately I do not have permissions to create a pull request @davidkarlsen Can help?

@mLjH
Copy link

mLjH commented Mar 27, 2023

@MananShah9 could you share the code you updated?

@bhamail
Copy link
Contributor

bhamail commented Mar 27, 2023

@MananShah9 You should be able to fork the repository and create a Pull Request from your fork.

@ArVar
Copy link

ArVar commented Jul 11, 2023

This is really an issue. This problem occurs apperently in scenarios with a corporate proxy. My proxy settings in .bashrc are not respected, as well. Somehow the interaction of my remote host, VSCode and the plugin regarding ssl settings is not clear for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants