> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/gateway/guides/certificates.md). Agents can also search and read this documentation through its [MCP server](https://docs.devolutions.net/~gitbook/mcp).

# Certificates and TLS

Devolutions Gateway certificate requirements: formats, Subject Alternative Name, Server Authentication EKU, strict verification and renewal.

Devolutions Gateway needs a TLS certificate as soon as its HTTP listener uses `https`. Web sessions opened from Devolutions Server or Devolutions Cloud, the recording player, session shadowing and the calls Devolutions Server and Devolutions Cloud make to the Devolutions Gateway API all go through that listener, so browsers and servers must trust the certificate. The certificate is also presented to clients during proxy-based credential injection, unless a separate CredSSP certificate is configured.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Change the Devolutions Gateway certificate</strong></td><td>Replace an expiring certificate from the Devolutions Server Console, with PowerShell, or in gateway.json.</td><td><a href="https://docs.devolutions.net/gateway/guides/certificates/change-certificate.md">Change the Devolutions Gateway certificate</a></td></tr><tr><td><strong>Use the Windows certificate store</strong></td><td>Let Devolutions Gateway load its certificate from the Windows certificate store and pick up renewals automatically.</td><td><a href="https://docs.devolutions.net/gateway/guides/certificates/windows-certificate-store.md">Use the Windows certificate store</a></td></tr></tbody></table>

## What the certificate must contain

<table><thead><tr><th width="260">REQUIREMENT</th><th>DETAILS</th></tr></thead><tbody><tr><td><strong>Subject Alternative Name (SAN)</strong></td><td>Every name or IP address clients use to reach Devolutions Gateway, for example <code>gateway.contoso.com</code>. Browsers and macOS reject certificates that only have a Common Name (CN).</td></tr><tr><td><strong>Extended Key Usage (EKU) Server Authentication</strong></td><td>The <code>serverAuth</code> purpose (OID 1.3.6.1.5.5.7.3.1).</td></tr><tr><td><strong>Full chain</strong></td><td>The certificate file must include the intermediate certificates, for example Root Certificate Authority – Intermediate Certificate Authority – gateway certificate. Clients that can't build the chain fail to connect.</td></tr><tr><td><strong>Server certificate</strong></td><td>A certificate issued to a server, not a certificate authority (CA) certificate.</td></tr><tr><td><strong>Valid dates</strong></td><td>Not expired and already valid. In the Windows certificate store, Devolutions Gateway skips certificates that aren't valid yet.</td></tr><tr><td><strong>Strong signature</strong></td><td>No MD5 or SHA-1 signature in the chain. Modern TLS clients reject them.</td></tr></tbody></table>

The Windows installer checks the certificate you select and shows the problems it finds, for example "The certificate is missing the Subject Alternative Name extension", "The certificate is missing the Server Authentication EKU extension", "The certificate file is missing one or more intermediate certificates. Re-export it with the intermediates included so clients can verify the certificate.", "The certificate is a CA certificate, not a server certificate. Verify that you have selected the correct file." or "The certificate is self-signed. Clients will not trust it unless they explicitly trust the certificate."

## Strict certificate verification (TlsVerifyStrict)

The `TlsVerifyStrict` key of `gateway.json` controls whether Devolutions Gateway refuses a certificate that has no Subject Alternative Name or no Server Authentication EKU.

<table><thead><tr><th width="260">VALUE OF TlsVerifyStrict</th><th>WHAT DEVOLUTIONS GATEWAY DOES</th></tr></thead><tbody><tr><td><strong><code>true</code></strong></td><td>A certificate file without SAN or without the Server Authentication EKU stops the service at startup. In the Windows certificate store, such certificates are skipped. Recommended.</td></tr><tr><td><strong><code>false</code></strong></td><td>The certificate is accepted. The log shows "TlsVerifyStrict option is explicitly set to false. This may hide latent issues." and event 3001 "TLS strict verification disabled" is written.</td></tr><tr><td><strong>Key absent</strong></td><td>Same as <code>false</code>. The log shows "TlsVerifyStrict option is not set, defaulting to false. This may hide latent issues."</td></tr></tbody></table>

The configuration file that Devolutions Gateway generates when none exists (Linux packages, and the Windows installer when you choose to configure Devolutions Gateway later) contains `"TlsVerifyStrict": true`. To add the key to an existing configuration, see [Harden Devolutions Gateway](https://docs.devolutions.net/gateway/for-administrators/hardening.md).

{% hint style="warning" %}
When the DevolutionsGateway PowerShell module saves `gateway.json`, it keeps only the keys it knows. Check and re-add `"TlsVerifyStrict": true` (and any other removed key) after a save. See [Manage Devolutions Gateway with PowerShell](https://docs.devolutions.net/gateway/for-administrators/powershell.md).
{% endhint %}

With strict verification on, a non-compliant certificate file stops the service with this error. The certificate is checked before logging starts, so the error is written to `boot.stacktrace` in the configuration folder and to event 1010 "Configuration invalid", not to the gateway log file:

"found significant issues with the certificate: serial\_number = …, subject = …, issuer = …, not\_before = …, not\_after = …, issues = … (you can set `TlsVerifyStrict` to `false` in the gateway.json configuration file if that's intended)"

Fix the certificate rather than turning strict verification off.

## Supported certificate sources and formats

<table><thead><tr><th width="220">SOURCE</th><th>FORMATS AND KEYS IN gateway.json</th><th width="160">PLATFORM</th></tr></thead><tbody><tr><td><strong>File, PEM</strong></td><td><code>TlsCertificateSource</code> = <code>External</code> (default). <code>TlsCertificateFile</code>: PEM file with the certificate chain (labels <code>CERTIFICATE</code>, <code>X509 CERTIFICATE</code> or <code>TRUSTED CERTIFICATE</code>). <code>TlsPrivateKeyFile</code>: PEM private key (labels <code>PRIVATE KEY</code>, <code>RSA PRIVATE KEY</code> or <code>EC PRIVATE KEY</code>).</td><td>Windows, Linux, Docker</td></tr><tr><td><strong>File, PFX</strong></td><td><code>TlsCertificateFile</code>: <code>.pfx</code> or <code>.p12</code> file that contains the certificate and its private key. <code>TlsPrivateKeyPassword</code>: the file password. No <code>TlsPrivateKeyFile</code> needed.</td><td>Windows, Linux</td></tr><tr><td><strong>Windows certificate store</strong></td><td><code>TlsCertificateSource</code> = <code>System</code>, with <code>TlsCertificateSubjectName</code>, <code>TlsCertificateStoreName</code> and <code>TlsCertificateStoreLocation</code>. See <a href="https://docs.devolutions.net/gateway/guides/certificates/windows-certificate-store.md">Use the Windows certificate store</a>.</td><td>Windows only</td></tr></tbody></table>

Relative file names are resolved from the configuration folder: `%ProgramData%\Devolutions\Gateway` on Windows, `/etc/devolutions-gateway` on Linux. The Windows installer, the Devolutions Server Console and the `Import-DGatewayCertificate` PowerShell command convert the certificate you give them to `server.crt` and `server.key` in that folder.

{% hint style="warning" %}
`TlsPrivateKeyPassword` is stored in clear text in `gateway.json`. Devolutions Gateway logs "Detected TlsPrivateKeyPassword option. This option doesn't inherently enhance security beyond using a plain, unencrypted private key." Protect access to the configuration folder, or use the Windows certificate store instead.
{% endhint %}

Common errors when the certificate files can't be used:

* "TLS usage implied, but TLS certificate file is missing": an `https` listener is configured without `TlsCertificateFile`.
* "TLS private key file is missing": a PEM certificate is configured without `TlsPrivateKeyFile`.
* "bad pem label (got …, expected one of …) at position N" or "couldn't parse first pem document": the file isn't a PEM certificate, or contains something else first.
* "failed to decode PFX", "leaf certificate not found", "leaf private key not found": the PFX file can't be read with the configured password, or doesn't contain the certificate and its key.

## Self-signed certificates

A self-signed certificate is fine for a test. Every browser, Remote Desktop Manager computer and the Devolutions Server or Devolutions Cloud side must then trust it explicitly.

<table><thead><tr><th width="260">WHERE</th><th>HOW IT'S GENERATED</th></tr></thead><tbody><tr><td><strong>Windows installer</strong></td><td>Option <em><strong>Generate a self-signed HTTPS certificate</strong></em>, available with <em><strong>Enable the Gateway web interface</strong></em>.</td></tr><tr><td><strong>PowerShell on Windows</strong></td><td><code>New-DGatewayCertificate [-Hostname &#x3C;name>]</code>: RSA 2048-bit, SHA-256, Server Authentication EKU, DNS name = the host name, valid 5 years.</td></tr><tr><td><strong>Docker image</strong></td><td>Generated at every start when <code>WEB_SCHEME=https</code> and no certificate is provided: RSA 2048-bit, CN = the host name of the container (<code>WEBSITE_HOSTNAME</code> on Azure, otherwise <code>HOSTNAME</code>), valid 5 years, no Subject Alternative Name. See <a href="https://docs.devolutions.net/gateway/for-administrators/install/docker.md">Run in Docker</a>.</td></tr><tr><td><strong>OpenSSL on Linux</strong></td><td>See the example below.</td></tr></tbody></table>

Example with OpenSSL, with a SAN and the Server Authentication EKU. Replace the name and the IP address with yours.

```shell
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
  -subj "/CN=gateway.contoso.com" \
  -addext "subjectAltName = DNS:gateway.contoso.com, IP:10.10.0.20" \
  -addext "extendedKeyUsage = serverAuth" \
  -keyout /etc/devolutions-gateway/server.key \
  -out /etc/devolutions-gateway/server.crt
```

To trust a self-signed certificate:

* **Ubuntu or Debian:** copy `server.crt` to `/usr/local/share/ca-certificates/`, then run `sudo update-ca-certificates`. Firefox doesn't use the system store and must be configured separately.
* **Windows:** import the certificate in ***Local Computer*** – ***Trusted Root Certification Authorities*** (`certlm.msc`, right-click ***Certificates*** – ***All Tasks*** – ***Import***).

## Let's Encrypt certificates on Linux

A certificate from a public authority such as Let's Encrypt is trusted everywhere without extra steps. With Certbot, the files are `fullchain.pem` (certificate with the chain) and `privkey.pem` (key) under `/etc/letsencrypt/live/<certificate name>/`.

1. Request the certificate, for example with the DNS challenge of your DNS provider's Certbot plugin.
2. Point Devolutions Gateway to the files. Edit `/etc/devolutions-gateway/gateway.json` as `root` and set the two keys:

```json
"TlsCertificateFile": "/etc/letsencrypt/live/gateway/fullchain.pem",
"TlsPrivateKeyFile": "/etc/letsencrypt/live/gateway/privkey.pem"
```

`Set-DGatewayConfig -TlsCertificateFile <file> -TlsPrivateKeyFile <file>` does the same, but the module removes the keys it doesn't know, including `TlsVerifyStrict`: re-add them after the command.

3. Make sure an `https` listener is configured, then restart the service: `sudo systemctl restart devolutions-gateway`.
4. Add a deploy hook so the service restarts after each renewal: `sudo certbot reconfigure --cert-name gateway --deploy-hook "systemctl restart devolutions-gateway"`.

The service installed by the Linux packages runs as `root`, which can read the Let's Encrypt files. If you run Devolutions Gateway under another account, give that account read access to the files and traverse access to their folders.

## When a new certificate is used

* **Certificate files:** read when the service starts. Restart the service after replacing the files.
* **Windows certificate store:** looked up again during TLS connections (cached about 45 seconds). A renewed certificate with the same subject name is used without restarting the service.

## Logs and events about certificates

<table><thead><tr><th width="120">EVENT ID</th><th>MESSAGE</th></tr></thead><tbody><tr><td>3000</td><td>TLS configured</td></tr><tr><td>3001</td><td>TLS strict verification disabled</td></tr><tr><td>3002</td><td>Certificate rejected</td></tr><tr><td>3005</td><td>TLS certificate name mismatch</td></tr><tr><td>3006</td><td>No usable certificate found</td></tr></tbody></table>

These events go to the Windows Application log (source ***Devolutions Gateway***) or to syslog on Linux (identifier `devolutions-gateway`). For detailed TLS logs, set `"VerbosityProfile": "Tls"` in `gateway.json` and restart the service. See [Logs and event IDs](https://docs.devolutions.net/gateway/help/troubleshooting/logs-and-events.md).

## Good to know

* Devolutions Gateway accepts TLS 1.2 and TLS 1.3 only. See [Harden Devolutions Gateway](https://docs.devolutions.net/gateway/for-administrators/hardening.md).
* A warning "Hostname doesn't match the TLS certificate subject name configured; not necessarily a problem if it is instead matched by an alternative subject name" means `Hostname` differs from the certificate subject. It's harmless when the name is in the SAN.
* Recordings fail when the client doesn't trust the certificate. See [Invalid TLS certificate for session recording](https://docs.devolutions.net/gateway/help/troubleshooting/recording-tls-certificate.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/gateway/guides/certificates.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
