Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Next »

There are two ways to run SonarQube over HTTPS:

  • By building a standard reverse proxy infrastructure
  • By configuring the SonarQube server that natively supports SSL (since version 4.0)

Building a Standard Reverse Proxy Infrastructure

The reverse proxy must be configured to set the value "X_FORWARDED_PROTO: https" in each HTTP request header. Without this property, redirection initiated by the SonarQube server will fall back on HTTP.


Configuring the SonarQube Server that Natively Supports SSL

The configuration is pretty standard. The information to access the certificate must be provided in the configuration of the web server. JVMs used by the analyzers (SonarQube Runner, Maven, etc.) must know of the certificate.

You'll find below a complete example: from the generation of an SSL Certificate to the configuration of the SonarQube web server and analyzers.

Generating the SSL Certificate

Run the following command:

It adds the certificate to USER_HOME/.keystore

Configuring the SonarQube Web Server

Open the SONARQUBE_HOME/conf/sonar.properties file and update it as below:

sonar.properties

Restart the web server. You should now only be able to access the SonarQube server over HTTPS on port 8999.

Configuring the Analyzers

From your browser, export the certificate into a file. Example with Chrome:

Click on Certificate information link and copy the certificate through the Details tab.

Add the certificate to the keystore of the JVM (that will be used by your analyzer) by running the following command:

Update the settings of your analyzer (SONARQUBE_HOME/conf/sonar-runner.properties or settings.xml for Maven...): sonar.host.url=https://localhost:8999

Analyze one of your projects.

 

  • No labels