To configure SSL in Sonrqube we have to configure on Sonarqube and windows IIS as well.
This are the steps.
- Copy the certificate.pfx to sonar server conf folder.
- Open the sonar.properties go to the WEB SERVER
- Add the following
sonar.web.https.port=443
sonar.web.https.keyPas=Password for certificate
sonar.web.https.keystoreFile=C:/Program Files/sonarqube-xx/sonarqube-xxx/conf/certificate.pfx
sonar.web.https.keystoreType=PKCS12
sonar.web.https.keyPas=Password for certificate
sonar.web.https.keystoreFile=C:/Program Files/sonarqube-xx/sonarqube-xxx/conf/certificate.pfx
sonar.web.https.keystoreType=PKCS12
- Login to Sonar and change the Server Base URL to https url.
- Then Install IIS in from control panel
- Install Microsoft URL Rewrite Module ( https://www.microsoft.com/en-us/download/details.aspx?id=4733)
- Install Application Request Routing ( https://www.iis.net/downloads/microsoft/application-request-routing.)
- Install the certificate.pfx to the IIS.
- Select the IIS server and go to Certificate and Import certificate.
- Select the IIS server and click add new Website create a website with SSL
- Select the website and go to URL Rewrite.
- Then go to Add Rule
- Create a rule sonarqube name make sure to select Enable SSL Offloading
- eg: sonar.knights.com:9000
- Next select View Server Variables.
- Set Server Variable.
- Next edit the URL Rewrite we have crated and go to Server Variables and Select the new variable we have created.
- Now you have configured SSL for SonarQube.