# Instalacja z certyfikatem SSL

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

{% hint style="warning" %}
Pamiętaj, że po zmodyfikowaniu ustawień XMS <mark style="color:$danger;">**musisz**</mark> zmienić protokół komunikacji agenta na HTTPS, aby usługa **Xopero ONE Backup\&Recovery** działała poprawnie.
{% endhint %}

{% hint style="info" %}
Więcej informacji na temat konfiguracji **Kestrel** znajdziesz [tutaj](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/endpoints?view=aspnetcore-5.0).
{% endhint %}

{% stepper %}
{% step %}
Otwórz plik `appsettings.json` znajdujący się w katalogu instalacyjnym **Xopero ONE Management Service**.
{% endstep %}

{% step %}
Znajdź linię `commented_out_Kestrel`.

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

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

{% endcode %}
{% endstep %}

{% step %}
Zmodyfikuj następujące linie kodu — usuń prefiks `commented_out_` i dodaj konfigurację HTTPS w następujący sposób:

{% 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:** ścieżka do pliku .pf&#x78;**\***&#x20;
>
> **Password:** hasło do certyfikatu
>
> **\***<mark style="color:red;">**WAŻNE!**</mark> Pamiętaj o użyciu podwójnego ukośnika — jeśli przechowujesz certyfikat w katalogu **C:**<mark style="color:red;">**\\**</mark>**cert.pfx**, ścieżka powinna zostać wprowadzona jako **C:**<mark style="color:red;">**\\\\**</mark>**cert.pfx**.
> {% endstep %}
> {% endstepper %}

***

## Konfiguracja Agenta

{% hint style="warning" %}
Zmiana adresu IP lub protokołu (http, https) **Management Service** spowoduje zmianę statusu aktywnego agenta na <mark style="color:$danger;">**offline**</mark>. Agent ponownie się połączy po przełączeniu protokołu na HTTPS.
{% endhint %}

{% stepper %}
{% step %}
Przejdź do katalogu instalacyjnego **Xopero ONE Agent** i otwórz plik `config.json`.

Domyślna lokalizacja pliku `config.json` to:

1. <img src="/files/BkF4yqlPcY8cysY3qDh8" alt="" data-size="line"> **Dla Windows:** <kbd>C:\Program Files\Xopero ONE Backup\&Recovery Agent</kbd>
2. <img src="/files/31OmlsZIaWiWpdja3qBY" alt="" data-size="line"> **Dla Linux:** <kbd>/opt/XoperoONEBackupAgent/</kbd>
   {% endstep %}

{% step %}
Zmień wartość `ServiceUrl` z **HTTP** na **HTTPS**.

{% hint style="success" %}
Możesz edytować plik `config.json` za pomocą prostego edytora tekstu (np. Notatnik, **Notepad++**).
{% endhint %}

<figure><img src="/files/5knqrgvEJ2OewdeXUL6z" alt=""><figcaption><p><em>Przykład pliku <code>config.json</code> otwartego w <strong>Notepad++</strong>.</em></p></figcaption></figure>
{% endstep %}

{% step %}
Po zmianie wartości agent ponownie pojawi się jako online.
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://helpcenter.xopero.com/xopero-one-en/pl/wdrozenie-i-konfiguracja/xopero-one-management-service/instalacja-z-certyfikatem-ssl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
