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

Unable to read ruleset on private git server with visual code #131

Open
RazorTheBeaver opened this issue Mar 23, 2022 · 3 comments
Open

Comments

@RazorTheBeaver
Copy link

Describe the bug
Unable to read ruleset on private git server with visual code

VSCODE SPECTRAL OUTPUT
An error occurred while validating document /home/USER/Documents/Bitbucket/PROJECT/folder/FILE_TO_LINT.yaml: Unable to read ruleset at /home/USER/Documents/Bitbucket/PROJECT/.spectral.yaml

To Reproduce

.spectral.yaml file

extends:

The bitbucket server is certified by an internal authority in my COMPANY with a ROOT_CA.

First step to debug:

  • Do it Manually with the spectral CLI

spectral lint FILE_TO_LINT.yaml --ruleset https://bitbucket.COMPANY.CN/projects/TITLE/repos/LINTING/global-ruleset.yaml

request to https://bitbucket.COMPANY.CN/projects/TITLE/repos/LINTING/global-ruleset.yaml failed, reason: unable to get local issuer certificate

  • Then, if I'm exporting -> export NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/ROOT_CA.crt

spectral lint FILE_TO_LINT.yaml --ruleset https://bitbucket.COMPANY.CN/projects/TITLE/repos/LINTING/global-ruleset.yaml

/home/USER/Documents/Bitbucket/PROJECT/folder/FILE_TO_LINT.yaml
10:12 warning XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
36:14 warning XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
89:18 warning XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

✖ 3 problems (0 errors, 3 warnings, 0 infos, 0 hints)

Expected behavior

Spectral in vscode should be able to accept ROOT_CA of a private COMPANY.

Environment:

  • Extension version: [v0.2.5]
  • VS Code version: [1.65.2]
  • Operating System: [Windows 10 && 20.04.1-Ubuntu]
@fednot-icc
Copy link

Issue persists in Extension version 1.0.0

@faithwah
Copy link

Issue persists in Extension version 1.2.0

@erik-hansen
Copy link

I am receiving a similar error, when my local ./spectral.yaml config extends a ruleset from an HTTPS URL that is self-signed by my corporate CA.

Unable to read ruleset at ./spectral.yaml. FetchError: request to https://[Internal_UNPKG_Server]/[Project]@latest/[Ruleset_File].yaml failed, reason: self signed certificate in certificate chain

I have set the NODE_EXTRA_CA_CERTS environment variable to a path that contains the Root CA for the self-signed cert, which works from Spectral cli. I also added https://marketplace.visualstudio.com/items?itemName=pharndt.node-extra-ca-certs-vscode to VSCode, which I would expect to pick up that env variable. Sop far, none of these changes have affected the result - still the same error coming from the Spectral extension.

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

4 participants