Cloudflare with Devolutions Gateway
Important Cloudflare Tunnel behavior: a Cloudflare named tunnel public hostname serves HTTP/HTTPS/WebSocket at the Cloudflare edge on port 443. It does not expose raw TCP as hostname:port on the public internet. For native RDM TCP relay sessions, each client must run cloudflared access tcp, which creates a local listener such as localhost:8181.
Log in to the Cloudflare dashboard.
Go to the Zero Trust section under the Cloudflare Dashboard. This may prompt you to choose a plan; the Zero Trust free plan will work.
Go to Networks – Tunnels & Mesh and click Create a tunnel.
Select Cloudflared and click Next.
Input a name and click Save tunnel.
Choose the appropriate operating system and architecture.
Download the installer via the given link.
Copy the configuration string.
Run the Cloudflare installer.
In the Install and run a connector section of the Cloudflare installation window, copy the command.
Open the server with the Cloudflare tunnel daemon installed, then open Command Prompt as an administrator.
Paste the configuration string copied in step 8, then press Enter.
Click Next.
Input a unique subdomain.
Choose HTTPS as Type. When using a self-signed certificate or an internal-CA certificate for Devolutions Gateway, enable the No TLS Verify option under Additional application settings – TLS.
Keep HTTP2 connection turned off for the HTTPS ingress. Devolutions Gateway uses WebSocket, and HTTP/2 to the origin can break WebSocket upgrades.
Click Complete setup.
Click on the newly created Tunnel name.
Click on Published application routes and then Add a published application route.
Input a unique subdomain (different from step 14).
Choose TCP as Type. Enter
localhost:8181if using the default port.
Cloudflare does not terminate TLS on the TCP path, and there is no TLS Verify setting for TCP. TLS validation happens end-to-end between the RDM client and Devolutions Gateway through the local cloudflared access tcp bridge.
When done, there should be two public hostnames.
Retrieve the provisioning key
The DVLS public key file needs to be accessible to the server hosting Devolutions Gateway, which is behind the Cloudflare tunnel.
Log in to the Devolutions Server or Devolutions Cloud instance as a user with access to the Devolutions Gateway configuration.
Go to Administration — Devolutions Gateway.
Click the More button and select Download public key.
Install Devolutions Gateway with Cloudflare
Open a connection to the server hosting Devolutions Gateway and download the installer.
Run the installer.
Click Next.
Once the desired installation path is selected, click the Next button.
Click Next.
Click Next in the Listeners window.
It is advisable to leave the default listeners in place, as they will likely correspond to the Cloudflare tunnel configuration.
Enter the external URI by which the gateway will be reachable.
Click Next.
Specify the path to the TLS certificates or to the system certificate store location.
The gateway certificate must include every name that a TLS client validates against. For the Cloudflare TCP bridge model, the client connects to localhost:<port>, so localhost must be in the certificate SAN, along with the gateway internal FQDN. The public Cloudflare tunnel hostnames typically do not need to be in the gateway certificate.
Click Next.
Specify the path to the previously retrieved public key from Devolutions Server or Devolutions Cloud.
Click Next.
Click Install.
Launch the Cloudflared client on the Remote Desktop Manager host
The Cloudflared client needs to be downloaded and launched to properly tunnel the connection. This client will create an outbound Cloudflare tunnel connection from any local Remote Desktop Manager client to the Cloudflare tunnel connecting to Devolutions Gateway.
The following code needs to be run in a terminal window as long as the tunnel needs to be open, and each time a gateway will be accessed behind a Cloudflare tunnel. The runnable client executable is cloudflared.exe (though you may need to rename the downloaded version). Use the same local port here as the TCP Listening Port configured in Devolutions Server or Hub Business.
The client software connects to localhost:8182, not to gateway-client-tcp.mydomain.com:8181. Because the TLS client validates the gateway certificate against localhost, the gateway certificate must include localhost in its SAN. If it does not, the gateway log may show received fatal alert: CertificateUnknown.
To avoid running the code every time, create a service:
Launch an elevated PowerShell session.
Input this code to create a new PowerShell service:
Start the service.
The tunnel is now running permanently on the client side.
Configure Devolutions Server
Log in to a Devolutions Server instance as a user with access to the Devolutions Gateway configuration.
Go to Administration — Devolutions Gateway.
Click the Add (+) button and choose Gateway.
Enter the previously retrieved details from Cloudflare used to configure Devolutions Gateway.
It may be needed to preface the Cloudflare tunnel domain with https://. Auto-detect will only work if the HTTPS hostname is reachable through Cloudflare.
Make sure not to use the TCP port at the end of the Gateway URL. The Gateway URL uses the Cloudflare HTTPS hostname on 443; the TCP port is configured separately as the TCP Listening Port.
Click Save.
Click the ellipsis (More) button next to the newly configured gateway and select Publish revocation list.
If the Publish Gateway configuration option is available, it should be done before Publish revocation list.
Configure Devolutions Cloud
Log in to a Devolutions Cloud instance as a user with access to the Devolutions Gateway configuration.
Go to Administration — Devolutions Gateway.
Click the Add (+) button.
Enter the previously retrieved details from Cloudflare used to configure Devolutions Gateway.
It may be needed to preface the Cloudflare tunnel domain with https://. Auto-Detect will only work if the HTTPS hostname is reachable through Cloudflare.
Go through any combination of Vaults, Groups, or Users tabs to decide how the licenses will be distributed.
Click Add.
Click the ellipsis (More) button next to the newly configured gateway and select Publish Gateway configuration.
Troubleshooting notes
received fatal alert: CertificateUnknownIn the gateway log, this usually means a TLS client rejected the gateway certificate due to a SAN/name mismatch. In this setup, that often means TCP Hostname islocalhostbutlocalhostis missing from the gateway certificate SAN.A red TCP listening hostname configuration diagnostic usually indicates that DVLS cannot reach raw TCP on the configured hostname. If it points at the public tunnel FQDN, change it to
localhostand ensure the localcloudflared access tcpbridge is running.Certificate could not be verified with blank fields, followed by
Cannot read properties of null (reading 'thumbprint'), usually means the gateway detect returned no certificate because the tunnel or gateway was unreachable. Fix reachability first.Cloudflare Error 1033 means Cloudflare cannot resolve the tunnel. Confirm the origin
cloudflareddaemon is running, and the tunnel status is Connected.
Last updated
Was this helpful?