# Advanced configuration

## HTTP configuration <a href="#http-configuration" id="http-configuration"></a>

To operate, SonarQube for Eclipse needs to perform HTTP requests, especially in [Connected mode](https://app.gitbook.com/s/NvI4wotPmITyM0mnsmtp/connect-your-ide/connected-mode "mention"). While SonarQube for Eclipse will work out-of-the-box in most situations, some network infrastructure may require a custom configuration.

## Passing SonarQube for IDE properties <a href="#passing-sonarqube-for-eclipse-properties" id="passing-sonarqube-for-eclipse-properties"></a>

In SonarQube for Eclipse, you must edit the eclipse.ini and define extra VM arguments, such as those we describe below.

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2Fgit-blob-a843eb4d864950f269e017ad40b9d3c7806430d2%2Fda4dd95cc9e78cc08a984804067e9ee71447674e.png?alt=media" alt="You&#x27;ll need to edit the eclipse.ini file to add advanced HTTP properties." width="372"><figcaption></figcaption></figure></div>

## Proxy configuration

When connecting to a SonarQube instance running behind a proxy, pass your proxy settings using the [Eclipse IDE Network Connections](https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Freference%2Fref-net-preferences.htm). In Eclipse, go to the **Settings** > **General** > **Network Connections** and enter your details.

## Manage your configuration <a href="#manage-your-configuration" id="manage-your-configuration"></a>

### HTTP Client timeouts <a href="#http-client-timeouts" id="http-client-timeouts"></a>

SonarQube for IDE supports various timeouts. Below you will find the properties added to control them:

`sonarlint.http.connectTimeout`

* Determines the timeout, in minutes, until a new connection is fully established.
* **Default**: 1 min

`sonarlint.http.socketTimeout`

* Determines the default socket timeout value, in minutes, for I/O operations.
* **Default**: infinite

`sonarlint.http.connectionRequestTimeout`

* The connection lease request timeout, in minutes, is used when requesting a connection from the connection manager.
* **Default**: 1 min

`sonarlint.http.responseTimeout`

* Determines the timeout, in minutes, until the arrival of a response from the opposite endpoint.
* **Default**: 10 min

### Server SSL certificates <a href="#server-ssl-certificates" id="server-ssl-certificates"></a>

SonarQube for IDE manages its own TrustStore in addition to the OS and Java TrustStores. When encountering an untrusted certificate, SonarQube for IDE will ask the user if the certificate should be trusted. If the answer is yes, the certificate will be added to the TrustStore.

SonarQube for IDE depends on you to provide server certificates when required by your environment. Here’s a generalization of a few basic steps you can use to help make that easier. Note that these instructions are for *server SSL certificates*. If you're dealing with a *client SSL certificate*, you'll need to create and configure a "key store" instead.

<details>

<summary>Install a server SSL certificate</summary>

**To install a server SSL certificate**

**Step 1:** Import your certificate into SonarQube for IDE. Here is a common command to import your certificate (`<Your_Certificate>.cer`) into a TrustStore (`C:/<Your_Path_To_Your_Truststore>`):

```bash
keytool -import -keystore C:/<Your_Path_To_Your_Truststore> -storepass password -noprompt -alias sonarqube-ssl -file <Your_Certificate>.cer
```

* Replace `C:/<Your_Path_To_Your_Truststore>` with your desired path and `password` with your chosen TrustStore password.

**Step 2:** Now that you’ve created the file, tell Eclipse where to find it by adding these lines to your eclipse.ini file. See the [#passing-sonarqube-for-eclipse-properties](#passing-sonarqube-for-eclipse-properties "mention") instructions for more details.

```bash
-Dsonarlint.ssl.trustStorePath=C:/<Your_Path_To_Your_Truststore>

-Dsonarlint.ssl.trustStorePassword=<Your_Password>

-Dsonarlint.ssl.trustStoreType=PKCS12
```

* Check that your path and password match what you used for your TrustStore.

**Step 3:** Restart your IDE.

</details>

**TrustStore**

**sonarlint.ssl.trustStorePath**

* Path to the keystore used by SonarLint to store custom trusted server certificates
* **default**: `~/.sonarlint/ssl/truststore.p12`

**sonarlint.ssl.trustStorePassword**

* Password of the truststore.
* **default**: `sonarlint`

**sonarlint.ssl.trustStoreType**

* The format of the keystore file is found in the [Oracle documentation](https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html#keystore-types).
* **default**: `PKCS12`

### Client SSL certificates <a href="#client-ssl-certificates" id="client-ssl-certificates"></a>

Some servers or proxies may also require SonarQube for IDE to authenticate using client-side SSL certificates. This is a rare use case, and at for the moment, there is no UI to configure client-side SSL certificates. To properly authenticate client-side SSL certificates, you must manually create a keystore at the default location, or use the following properties:

**KeyStore**

**sonarlint.ssl.keyStorePath**

* Path to the keystore used by SonarQube for IDE to store client certificates.
* **default**: `~/.sonarlint/ssl/keystore.p12`

**sonarlint.ssl.keyStorePassword**

* Password of the keystore.
* **default**: `sonarlint`

**sonarlint.ssl.keyStoreType**

* The format of the keystore file is found in the [Oracle documentation](https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html#keystore-types).
* **default**: `PKCS12`

## Providing a Java runtime <a href="#providing-a-java-runtime" id="providing-a-java-runtime"></a>

SonarQube for Eclipse 10.0+ provides its own JRE if the IDE’s JRE doesn’t match the minimum requirement for Sonar’s analyzers. This ensures that SonarQube for Eclipse can be compatible with Eclipse IDEs running on Java 11. However, it’s possible to define a unique, self-managed Java runtime in the SonarQube Eclipse **Preferences** window.

To define a self-managed runtime, go to **Window** > **Preferences** > **SonarQube** (**Eclipse** > **Settings…** > **SonarQube** for macOS), select the Java installation path; then restart your IDE.

* After the restart, the **SonarQube Console** will display the specified Java runtime, matching the SonarQube **Preference** window.

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2Fgit-blob-4be4cad97a57d8855b4751084ad85e82a4b77cf9%2F896f84be911bce807bce379ff770908eb3da499e.png?alt=media" alt="SonarQube for Eclipse using the self-managed Java installation." width="563"><figcaption></figcaption></figure></div>

* If you provide your own runtime, please check that your environment matches the version [requirements](https://docs.sonarsource.com/sonarqube-for-eclipse/getting-started/requirements "mention"). If the specified runtime is moved or cannot be found, SonarQube for Eclipse will see the field as blank.
* If the field is blank, SonarQube for Eclipse will default to the Eclipse JRE *as long as it meets the minimum requirement*. This will be displayed in both the **Preferences** and the **SonarQube Console**.
* If the Eclipse JRE does not meet the minimum requirement, SonarQube for Eclipse will use its own JRE. This will be displayed in both the **Preferences** and the **SonarQube Console**.
