Search code examples
eclipsesonarqubesonarlinteclipse-oxygensonarlint-eclipse

Unable to connect to SonarQube Server using HTTPS in Eclipse Oxygen (SonarLint Plugin)


I followed the steps in the SonarQube docs to allow my SonarQube server to use HTTPS by putting a Proxy behind it: https://docs.sonarqube.org/display/SONAR/Securing+the+Server+Behind+a+Proxy

I created an apache server and installed mod_proxy module by following these instructions: http://frvabe.blogspot.com/2016/06/running-sonarqube-behind-proxy.html

When I add the server using http and the default port 9000 the connection is successful. However when I try adding a SonarQube server using https and 8443 I get the fail to request error (Yes I am putting the credentials correctly :)): Error

I am able to access the URL with https and port 8443 from IE i.e. "https://myserver.com:8443/". I login and view all projects with no problem.

I do not see any error logs anywhere (workspace, installation directory, IDE error views, event viewer, etc.)

I know that it has to do with the certificate not being "trusted" since in is a self-signed certificate. Is there a way to tell SonarLint to "Trust" this certificate?

Any help will be greatly appreciated.

Thank you!

JP


Solution

  • You can add this certificate to the java cacerts store. After that it is trusted for Java. you have to do this for the Java version you are using on Eclipse.

    Here is an example of the calls for github.com:

    "C:\Program Files\Java\jdk1.8.0_121\bin\keytool" -keystore cacerts –list
    
    "C:\Program Files\Java\jdk1.8.0_121\bin\keytool" -keystore cacerts -importcert -alias github.com -file C:\temp\github.com.cer
    

    Note: you have to open the CMD in the folder where the cacerts file is located. This is normally in C:\Program Files\Java\jre1.8.0_121\lib\security or C:\Program Files\Java\jdk1.8.0_121. The path is here only an example.