# Installation with an SSL certificate

## Kestrel configuration <a href="#using_your_own_ssl_certificate" id="using_your_own_ssl_certificate"></a>

{% hint style="danger" %}
Remember that once you modify the **Management Service** settings you **must** switch the agent's communication protocol to HTTPS for the **GitProtect** service to work correctly.
{% endhint %}

{% hint style="info" %}
You can find more information about **Kestrel** configuration [here](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/endpoints?view=aspnetcore-5.0).
{% endhint %}

{% stepper %}
{% step %}
Open `appsettings.json` file located in **GitProtect Management Service** installation directory.
{% endstep %}

{% step %}
Find `commented_out_Kestrel` line.

{% code title="Default commented\_out\_Kestrel line:" overflow="wrap" %}

```json
"commented_out_Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://*:5000"
}
}
```

{% endcode %}
{% endstep %}

{% step %}
Modify the following code lines — erase `commented_out_` prefix and add the HTTPS configuration as follows:

{% code title="Modified commented\_out\_Kestrel section:" overflow="wrap" %}

```json
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://*:5000"
},
"Https": {
"Url": "https://*:5001",
"Certificate":{
"Path": "<.pfx file path>",
"Password": "<certificate password>"
}}}}}
```

{% endcode %}

> **Path:** path to the .pfx fil&#x65;**\***
>
> **Password:** certificate password
>
> **\***<mark style="color:red;">**IMPORTANT!**</mark> Remember to use double slash— if you're keeping the certificate in **C:**<mark style="color:red;">**\\**</mark>**cert.pfx** directory, the path should be entered as **C:**<mark style="color:red;">**\\\\**</mark>**cert.pfx** instead.
> {% endstep %}
> {% endstepper %}

***

## Worker configuration

{% hint style="warning" %}
Modifying the IP address or the protocol (http, https) of the **Management Service** will change the active worker's status to **offline**. It will reconnect once you switch the worker's protocol to HTTPS.
{% endhint %}

{% stepper %}
{% step %}
Go to your **GitProtect worker** installation directory and open `config.json` file.

Default location of the `config.json` file is:

1. <img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-0983f27108ffae02c117ceb8f14111904f36bc36%2Ficon%20(1).png?alt=media" alt="" data-size="line"> **For Windows:** `C:\Program Files\Xopero ONE Backup&Recovery Agent`
2. <img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-e996cf7cb639ee9499504b166c9ae575f4214178%2Ficon.png?alt=media" alt="" data-size="line"> **For Linux:** `/opt/XoperoONEBackupAgent/`
   {% endstep %}

{% step %}
Change the `ServiceUrl` value from **HTTP** to **HTTPS**.

{% hint style="success" %}
You can edit `config.json` with a simple text editor (i.e., **Notepad**, **Notepad++**).
{% endhint %}

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-c592fa1b09b61cd8c79662dc95904bfc5f13154a%2Fimage%20(412).png?alt=media" alt=""><figcaption><p><em>Example of <code>config.json</code> file opened in <strong>Notepad++</strong>.</em></p></figcaption></figure>
{% endstep %}

{% step %}
Once the value is changed, the worker will come back online.
{% endstep %}
{% endstepper %}
