> For the complete documentation index, see [llms.txt](https://kb.mago.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.mago.io/mago-stage/network-requirements/on-premises-certificates-and-proxies.md).

# On-premises certificates and proxies

On-premises certificates and proxies  Production on-premises deployments should use HTTPS and secure WebSockets for all browser-accessible services.

Trusted certificates are especially important for authentication, screen sharing, camera access, microphone access, Stage VC, and WebRTC.

### Certificate requirements

Certificates used by Mago Stage must:

* Be valid for the service hostname
* Be within their validity period
* Include the required intermediate certificate chain
* Be trusted by controllers, receivers, servers, and administrator devices
* Use a supported key type and strength
* Be available in PEM format where certificate files are loaded directly
* Have a private key matching the certificate
* Be renewed before expiration

The certificate’s Subject Alternative Name must contain every hostname presented to clients.

Modern clients require the service hostname in the certificate’s Subject Alternative Name. The Common Name is ignored for hostname validation.

### Certificate coverage

Using the example `magosrv.com` service names, certificates must cover the corresponding hostnames.

| Service                | Example hostname          | Certificate requirement                                |
| ---------------------- | ------------------------- | ------------------------------------------------------ |
| Mago Stage API         | `api.magosrv.com`         | Certificate must include `api.magosrv.com`             |
| Administration Portal  | `admin.magosrv.com`       | Certificate must include `admin.magosrv.com`           |
| Remote Controller      | `remote.magosrv.com`      | Certificate must include `remote.magosrv.com`          |
| Present web controller | `present.magosrv.com`     | Certificate must include `present.magosrv.com`         |
| Stage VC               | `vc.magosrv.com`          | Certificate must include `vc.magosrv.com`              |
| WebRTC signaling       | `webrtc.magosrv.com`      | Certificate must include the WebRTC signaling hostname |
| WebRTC TURN            | `turn-webrtc.magosrv.com` | Certificate must include the TURN hostname             |

Replace the example hostnames with the names assigned to the deployment.

### Wildcard certificates

A wildcard certificate such as:

`*.magosrv.com`

can cover first-level hostnames including:

* `api.magosrv.com`
* `admin.magosrv.com`
* `remote.magosrv.com`
* `present.magosrv.com`
* `vc.magosrv.com`
* `webrtc.magosrv.com`
* `turn-webrtc.magosrv.com`

The wildcard does not cover:

* The root name `magosrv.com`
* A deeper name such as `api.eu.magosrv.com`
* A service using a different domain

Confirm that the certificate includes every required hostname before deployment.

### Stage VC certificate files

Stage VC loads its certificate from the `certs` folder in the main Mago Stage installation directory.

| File      | Purpose                                         |
| --------- | ----------------------------------------------- |
| `tls.crt` | Stage VC certificate and certificate chain      |
| `tls.key` | Matching private key                            |
| `ca.crt`  | Optional additional certificate-authority chain |

The certificate must match the hostname used to access Stage VC, such as:

`vc.magosrv.com`

Without `tls.crt` and `tls.key`, Stage VC can fall back to plain HTTP. Browsers generally block camera and microphone access over insecure HTTP except on localhost.

Use HTTPS for production Stage VC deployments.

### WebRTC certificate files

The bundled WebRTC TLS service uses a separate certificate folder and different filenames.

Place the files in the WebRTC `certs` folder:

| File       | Purpose                                                             |
| ---------- | ------------------------------------------------------------------- |
| `cert.pem` | Certificate chain containing the leaf and intermediate certificates |
| `key.pem`  | Matching unencrypted private key in PEM format                      |

The certificate must cover both the WebRTC signaling hostname and the TURN hostname.

For example:

* `webrtc.magosrv.com`
* `turn-webrtc.magosrv.com`

A wildcard certificate can cover both names when they use the same parent domain.

The bundled WebRTC TLS configuration does not automatically request certificates from a public certificate authority. The customer or installer must provide the certificate files.

If the required WebRTC certificate files are missing, the installer can fall back to plain LAN mode using `ws://<server-address>:7880`.

Plain LAN mode is not recommended for browser-based production deployments.

### Public and private certificate authorities

A public certificate authority is recommended when services are accessed by unmanaged devices, external users, or devices outside the customer’s domain.

A private certificate authority can be used for internal-only deployments if every connecting device trusts the issuing authority.

When using a private certificate authority:

* Install the root and required intermediate certificates on every controller.
* Install them on every receiver.
* Install them on administrator devices.
* Install them on the server and reverse proxy where required.
* Confirm trust in both applications and browsers.
* Include mobile devices in the certificate deployment plan.

Manually accepting a browser certificate warning is not a valid production configuration. Native applications and WebSocket clients may reject the connection without offering an override.

### Private-key protection

Private keys must be treated as secrets.

* Restrict access to authorized administrators and service accounts.
* Do not include private keys in support packages.
* Do not include private keys in screenshots.
* Do not commit private keys to source control.
* Do not send private keys through unapproved email or messaging systems.
* Back up keys only through an approved secrets-management or backup process.

The WebRTC `key.pem` file must be unencrypted for the service to load it automatically. Protect access to the file and its containing directory accordingly.

### Certificate renewal

Record the following for every certificate:

* Covered services
* Issuing authority
* Issue date
* Expiration date
* Renewal owner
* Renewal process
* Required service restart
* Validation procedure

Before replacing a certificate:

1. Confirm that the new certificate covers every required hostname.
2. Confirm that the private key matches the certificate.
3. Confirm that the complete intermediate chain is included.
4. Back up the active certificate according to the organization’s security policy.
5. Replace the certificate files or update the reverse proxy.
6. Restart or reload the affected service.
7. Test the service from a controller, receiver, and administrator device.
8. Confirm the new expiration date.
9. Update the organization’s deployment records with the new certificate details and expiration date.

Do not wait until the expiration date to test a replacement certificate.

### Reverse-proxy requirements

A reverse proxy used with Mago Stage must:

* Terminate TLS using a valid certificate
* Route each hostname to the correct internal service
* Preserve the original hostname
* Forward client protocol information
* Preserve authorization headers
* Support WebSocket upgrades
* Allow long-lived WebSocket connections
* Support file uploads and downloads
* Use suitable request-size limits
* Use suitable connection and request timeouts

A basic web-page test is not sufficient. A proxy may successfully load the Portal while still blocking WebSockets, uploads, or real-time communication.

### WebSocket proxy behavior

The Mago Stage API uses WebSockets for device signaling and live status.

The proxy must preserve:

* The HTTP upgrade request
* The `Upgrade` header
* The `Connection` header
* Authentication information
* Long-running connections

Avoid short idle timeouts. Closing idle WebSockets too aggressively can make receivers appear offline or delay commands.

The signaling path is:

`/api/hubs/signal`

### WebRTC proxy considerations

WebRTC uses more than ordinary HTTPS traffic.

It can require:

* Secure WebSocket signaling
* ICE over TCP
* WebRTC media over UDP
* TURN over UDP
* TURN over TLS

A standard HTTP reverse proxy does not automatically proxy WebRTC UDP media.

The bundled WebRTC TLS gateway uses the requested TLS hostname to route signaling and TURN traffic. The signaling and TURN hostnames must:

* Resolve to the correct server
* Be included in the certificate
* Be permitted through the firewall
* Route to the correct WebRTC services

Confirm that TCP 443 is not already assigned to an incompatible service on the same server address.

### Forwarded client information

When Mago Stage is placed behind a reverse proxy, the application may need forwarded headers to determine:

* The original HTTPS scheme
* The public hostname
* The client address
* The correct SSO callback address

Only trust forwarded headers from known proxies or networks.

Do not configure the application to trust forwarded headers from every source unless the security implications have been reviewed.

### TLS inspection

TLS inspection can interfere with:

* Certificate validation
* WebSocket connections
* WebRTC signaling
* Real-time media
* SSO redirects
* Cloud-storage authentication
* Application downloads

Where inspection is required, test every enabled workflow through the production inspection service.

Create approved inspection exceptions for affected authentication, WebSocket, media, or application-download endpoints when required.
