Search code examples
visual-studio-codesonarqubeself-signedsonarlint

SonarLint on VSCode doesn't work with self signed SonarQube server


We have a SonarQube server which is hosted on a private network which can only be accessible via VPN. URL's something like: https://sonar.internal

Our server is using a Self Signed SSL certificate and it works well on browsers (you may get a warning but can move past it).

However, the issue is that on SonarLint on VSCode, when I try to use Connected Mode, I get the following error:

Failed: Certificate for <sonar.internal> doesn't match any of the subject alternative names: [*.internal, other.internal]

However, the certificate's common name has this name already; so it should not even go to alternative names.

I have two questions:

  1. How do I find the logs for the SonarLint within VSCode?
  2. How do I make it trust the certificate?

PS: I have been on various other posts and there is never anything crystal clear.

Thanks in advance


Solution

  • Figured it out

    1. How to enable VSCode Logs for SonarLint?

    Go to VSCode Settings Under Extensions, expand SonarLint Enable Sonarlint › Output: Show Verbose Logs Restart VSCode

    Then, go to Terminal and you will see a tab for Output Select SonarLint from the dropdown (mine defaults to Tasks)

    1. How do I make it trust the certificate?

    As it turns out, the self signed certificate indeed needed to have the URL into the Alternative Names. To me, that doesn't make any sense as the browser's behaviour is to first look at the Common Name and then go to Alternative Names. But apparently not the case in the VSCode plugin. I created another self-signed SSL certificate with the url into the Common Name and Alternative Names and viola - works like a charm now.

    Hope this helps someone.