Open the web page over HTTPS¶
TriggerGate serves its web page over HTTPS, so that browsers on other computers and phones can open it securely. Each TriggerGate installation creates its own small certificate authority (CA) the first time it starts, and issues its HTTPS certificate from it. You install that CA once on each computer or phone that opens the web page. After that, the browser connects with no certificate warning.
The web page runs in the browser on .NET WebAssembly, which browsers start only on a secure page: one loaded over HTTPS, or from localhost.
Programs that use the TriggerGate hub, such as the .NET client library, are not affected. The hub stays on plain HTTP on port 9090 on all three builds.
In the table below, the Windows service and the Uno build serve the certificate page on port 9090, the same port as the hub. The ESP32 board serves it on port 80, and also on ports 9090 and 443. In the ESP32 board's secure name, <id> is the last three bytes of its Ethernet MAC address, written as six hexadecimal digits.
Addresses¶
| Build | Certificate page | Secure address | On the device itself |
|---|---|---|---|
| Windows service | http://<host>:9090/.well-known/gameshowpro/ |
https://<host>-triggergate.local:9190/ |
http://localhost:9090/ |
| Uno | http://<host>:9090/.well-known/gameshowpro/ |
https://<host>-triggergate.local/ |
Not available |
| ESP32 board | http://<host>/.well-known/gameshowpro/ |
https://triggergate-<id>.local/ |
Not available |
In the certificate page's address, <host> is the device's name or IP address. The secure address uses a name that TriggerGate chooses: for Windows service, <host>-triggergate.local (for example https://studio-pc-triggergate.local:9190/); for Uno, <host>-triggergate.local (for example https://uno-1-triggergate.local/); for ESP32 board, triggergate-<id>.local (for example https://triggergate-a1b2c3.local/). The certificate page shows the exact secure address.
On builds that can be opened locally, find the address for another computer by opening the certificate page on the computer running TriggerGate, using its localhost address. Address for other computers shows the secure address with a Copy secure address button. Share that address with computers that already trust the CA. Scan the QR code on a phone to open the plain-HTTP setup address first; the phone can install the CA before the page forwards it to HTTPS. The secure address is shown as text on the host computer because that computer may not trust its own CA.
For Windows service, the block also lists HTTPS IP addresses for the selected networks when available. If several are listed, use the address on the network shared with the other computer. Use one on networks where .local names do not resolve. The browser shows a certificate-name warning for an HTTPS IP address. After you accept it, the certificate page checks the .local address and offers Continue on this address if that check fails.
Set up a computer or phone¶
Do this once on each computer or phone that opens the web page.
- Open the certificate page from the table above. Opening a plain-HTTP page from another computer takes you there too. The page remembers the path and query you opened, and forwards you to that page at the secure address after the trust check succeeds. API requests are left alone.
- Check the fingerprint. The page shows the CA's fingerprint. To be sure you are trusting the right device, compare it with one from a source you trust: the same page opened at the device itself, where that is possible, or your administrator.
-
Download and install the certificate. The page offers the right file for your system and lists the steps. In short:
System What to do Windows Open the downloaded file, choose Install Certificate, and place it in Trusted Root Certification Authorities. macOS Add the file to the System keychain in Keychain Access, open it, and set it to Always Trust. iPhone and iPad Download the profile in Safari, install it in Settings, then turn on full trust under General, About, Certificate Trust Settings. Android Download the certificate. On Android 11 or later, do not open it from the download notification: open Settings, search for Install a certificate, choose CA certificate, tap Install anyway, and pick the downloaded file. Linux Add the file to the system's trusted certificates, and import it into Chrome or Firefox, which keep their own lists. -
Open the secure address. Once the browser trusts the CA, the certificate page forwards you there by itself after a short countdown.
Later visits need only the secure address. Bookmark it.
If the check fails, install the certificate as described above. If you opened the certificate page through HTTPS by IP or another name, Continue on this address lets you stay on that HTTPS address for this browser session after the .local check fails. The browser's certificate-name warning still appears before the page opens; this choice cannot remove it. Use the app's certificate-page link to return and finish setup later. Closing the browser normally ends a session choice, although browsers that restore session cookies may keep it.
For Windows service, if you reached the certificate page over plain HTTP and the check fails, Open this address over HTTPS takes you to setup on the same host using the HTTPS port. The page shows that address and explains the browser's certificate-name warning. After accepting the warning, use Continue on this address if the check still fails. Your original path and query are kept. This link is not shown on localhost.
For Uno, if you reached the certificate page over plain HTTP and the check fails, Open this address over HTTPS takes you to setup on the same host using the HTTPS port. The page shows that address and explains the browser's certificate-name warning. After accepting the warning, use Continue on this address if the check still fails. Your original path and query are kept. This link is not shown on localhost.
For ESP32 board, if you reached the certificate page over plain HTTP and the check fails, Open this address over HTTPS takes you to setup on the same host using the HTTPS port. The page shows that address and explains the browser's certificate-name warning. After accepting the warning, use Continue on this address if the check still fails. Your original path and query are kept. This link is not shown on localhost.
On the Windows service and the Uno build, the secure name starts with the computer's own name. If the computer is renamed later, the old name keeps working until you reset.
What to know¶
- The certificate is valid for one name only. It works for the secure address in the table and for nothing else: not the bare computer name, not an IP address, and not
localhost. An address such ashttps://192.168.1.20:9190/shows a certificate warning even after the CA is installed. Use the.localname when your computer can find it. If you continue past a warning at another HTTPS name, the certificate page checks the matching.localname before forwarding you with the same path and query; it cannot prevent that first warning.localhostis left alone. - The CA cannot be misused for other sites. It is restricted to that one name, so it cannot vouch for a bank, a mail server or any other address, even if someone stole its key. You install only the public certificate; no private key ever leaves TriggerGate.
-
The warning-free address needs
.locallookup. Windows 10 and later, macOS, iPhone, iPad and most Linux desktops can find.localnames. Android can from version 12. Some Linux systems needavahi-daemonandlibnss-mdns. The lookup uses mDNS (UDP port 5353, multicast), so it fails across routers, on guest Wi-Fi that isolates devices from each other, and through a firewall that blocks multicast. On builds that offer Continue on this address, HTTPS by IP can still work after you accept the browser's certificate-name warning. -
Firewall and network selection. The TriggerGate device must accept connections from your network on the TCP ports in the table, and mDNS on UDP port 5353. See firewall settings. If the app is configured to listen on selected networks, use an address on one of those networks; mDNS advertisement scopes alone do not limit which addresses accept connections.
-
Firefox keeps its own list of trusted certificates. Import the file into Firefox as well (Settings, Privacy & Security, View Certificates, Authorities), or on Windows turn on
security.enterprise_roots.enabledinabout:config. - The clock matters. A computer or phone whose date is wrong may reject the certificate as not yet valid or expired.
- Not yet verified: iPhone and iPad, Android, macOS, Firefox, the Uno build, name lookup from Linux computers. The steps for these follow each system's documentation and have not been tried with TriggerGate. Report what you find.
- On the Windows service's own computer, no certificate is needed. A browser there can open
http://localhost:9090/, becauselocalhostcounts as a secure page. - From another computer, TriggerGate's web page needs HTTPS. The page needs a secure context (see the reason above), so the certificate page does not offer to continue over plain HTTP. The web page has a Secure access and certificate link in its Service panel, which opens the certificate page in a new tab.
- An ESP32 board allows three HTTPS connections at once. Each open web page keeps one open for its live connection, so close pages you are not using.
- The first load from an ESP32 board is slow. The web page can take 10 seconds or more to load the first time. Later visits take a few seconds.
- An ESP32 board dates its certificates from your browser's clock. It does not use its NTP clock for certificates: Renew and Reset take the time from your browser, so the computer or phone you use must have the right date and time. The certificate a board creates at its first start is dated from its firmware's build time instead.
Renewal and reset¶
For the Windows service and Uno, TriggerGate renews its HTTPS certificate by itself when fewer than 90 days of its validity remain. Computers and phones that already trust the CA keep working, and nobody has to do anything.
For the ESP32 board, the HTTPS certificate must be renewed before it expires. The certificate page shows when that is and has a Renew certificate button. Computers and phones that already trust the CA keep working after a renewal.
A reset creates a completely new CA. Every computer and phone must then install the new certificate, and should remove the old one. The certificate page shows the old one's fingerprint as Previous fingerprint so you can tell which to remove. Reset only when you must: when the key may have been exposed, or to adopt a new name after a rename.
The Renew certificate and Reset identity buttons are on the certificate page. They are refused unless you show that you are at the device:
-
On the computer itself (Windows service, Uno). Open the certificate page on the TriggerGate computer with a
localhostaddress:http://localhost:9090/.well-known/gameshowpro/. The buttons are refused from anywhere else on the network. On a computer with no screen, reach the page through an SSH tunnel (ssh -L 9090:127.0.0.1:9090 <host>, then open the samelocalhostaddress on your own computer), or run this on the computer itself, withresetin place ofrenewfor a reset: -
After a power-up (ESP32 board). Switch the device off and on again, then press the button on the page within 5 minutes. A restart from software does not count.
A device that can take a certificate from your own authority shows one more section on the certificate page, Your own certificate. It lists which certificate the device serves and its names, and lets you upload a certificate with its private key (over HTTPS only), create a signing request and upload the signed certificate (which also works over plain HTTP), or remove your certificate. These changes use the same protection as Renew and Reset; where the device reports how long its five-minute window after power-up stays open, the page counts it down and disables the buttons when it ends. The page recommends the signing request first (the device's key is an elliptic-curve key) and warns that an uploaded RSA key makes every secure connection slower to set up. The section does not appear on devices that do not report this ability.
If the device is renamed, or two devices share a name¶
- Renamed. The secure address keeps the old name until you reset, and keeps working. The certificate page tells you when the name no longer matches. A reset adopts the new name.
- Two devices with the same name. If another device on the network answers to the same
.localname, the secure address may reach the wrong one, and the certificate page shows a warning. TriggerGate does not rename itself, because the certificate would no longer match. Remove or rename the other device, or rename this one and reset.
Remove the certificate from a computer or phone¶
Remove the CA when a computer or phone no longer needs the web page, and remove the old CA after a reset. It is listed as GameshowPro Device CA followed by the device name. Check the fingerprint when several are installed.
| System | Where |
|---|---|
| Windows | Manage computer certificates (or Manage user certificates), Trusted Root Certification Authorities, Certificates. |
| macOS | Keychain Access, System keychain. |
| iPhone and iPad | Settings, General, VPN & Device Management: remove the profile. |
| Android | Settings, search for Trusted credentials, User tab. |
| Linux | Delete the file you copied and run the same update command again. Remove it from Chrome and Firefox too. |
Where the keys are kept¶
TriggerGate keeps the CA and its private keys here:
- Windows service:
%ProgramData%\GameshowPro\TriggerGate\tls - Uno:
/var/lib/gameshowpro/triggergate/tls
This folder holds private keys. Do not copy it into a backup, an archive, a support bundle or a shared drive. If it is lost or deleted, TriggerGate creates a new CA the next time it starts, and every computer and phone must install the new certificate, exactly as after a reset.
On the Windows service, the folder is limited to the service account, SYSTEM and administrators, and the private keys are encrypted with Windows data protection on that computer. If the service is changed to run as a different account, it may no longer be able to read them. HTTPS then stops working until you reset. See If it does not work.
On the Uno build, only the service's account (root) can open the folder, and the keys are not encrypted. An upgrade does not touch the folder, because it is outside the program folder.
An ESP32 board keeps its keys in its own flash memory, not in a folder you can reach. The flash is not encrypted, so anyone who can take the board and read its memory can get its keys. That would let them impersonate this one board, and nothing else, because of the name restriction. Erasing the board's flash, including a full erase when it is reflashed, also erases the keys. The board then creates a new CA the next time it starts, and every computer and phone must install the new certificate, exactly as after a reset.
Use your own certificate¶
If your organization issues certificates, or you have one from a public authority, TriggerGate can serve its web page with that certificate instead of its own CA. This applies to the Windows service and Uno.
| Setting | Meaning |
|---|---|
TriggerGate__CertificatePath |
The certificate file: a PFX (PKCS #12) file, or a PEM file that holds the certificate followed by any intermediate certificates. |
TriggerGate__CertificateKeyPath |
The private key file, when the certificate is a PEM file and its key is in a separate file. |
TriggerGate__CertificatePassword |
The password of the PFX file or of an encrypted key file. Leave it out when there is none. |
The account that TriggerGate runs as must be able to read the files. Restart TriggerGate after changing these settings.
With your own certificate:
- The address is the name in your certificate, on the same HTTPS port:
https://<name in your certificate>:9190/. Your network's DNS must lead that name to the TriggerGate computer. The.localsecure address is no longer offered. - Plain-HTTP page visits use HTTPS when the host matches a DNS name covered by your certificate. Other names, IP addresses and
localhostare left alone. - There is nothing to install on computers and phones that already trust whoever issued the certificate. The certificate page shows a short notice in place of the downloads, and has no Renew certificate or Reset identity button.
- On Windows, intermediate certificates must be installed. If your certificate was issued through an intermediate authority, install that authority's certificate in Intermediate Certification Authorities on the TriggerGate computer (Manage computer certificates). Windows sends only what it finds there; TriggerGate adds nothing to the certificate stores. On Linux the intermediates in the file are sent.
- Renewal is yours. Replace the files before the certificate expires. TriggerGate starts using the new files by itself, with no restart, and its log warns from 30 days before the expiry.
- A certificate that cannot be loaded stops HTTPS until the files are corrected. TriggerGate does not fall back to its own CA, because that would silently change what browsers must trust. The log says what is wrong.
- To return to TriggerGate's own CA, remove the settings and restart. The CA is kept, so computers and phones that installed it earlier still trust it.
The settings are set as described under Settings. A certificate configured through Kestrel (an https endpoint, or Kestrel's default certificate) is also accepted: see A certificate set through Kestrel.
With your own certificate, opening a page at the plain HTTP address from another computer, by a name your certificate covers, takes you straight to the same page at the secure address. Opening it by another name, by IP address or at localhost leaves you on plain HTTP, because the certificate would not be valid there. TriggerGate's own redirect of the plain HTTP root to HTTPS is used only with a certificate configured through Kestrel.
An ESP32 board cannot be given a certificate through settings. You upload one, or have the board create a signing request for your CA to sign; see Your own certificate on the ESP32 board. The other HTTPS settings, the ports and the certificate authority are described in HTTPS settings and your own certificate.
Settings¶
Application maintainers who configure Kestrel endpoints themselves can let TlsCa provide the certificate selector. Call AddGameshowProTlsCa before adding generated HTTPS endpoints, then compose the app's HTTPS defaults and TlsCa in one action:
ITlsCaHttps tls = kestrel.ApplicationServices.GetRequiredService<ITlsCaHttps>();
kestrel.ConfigureHttpsDefaults(https =>
{
// Apply the app's other HTTPS defaults here.
tls.Configure(https);
});
Set TlsCaOptions.AppOwnsListeners = true (default false) when the app owns endpoint configuration. The library then adds no listeners in any mode; the app configures all HTTP and HTTPS endpoints itself. HttpPort and HttpsPort remain the app's actual ports for redirects and discovery. A TlsCaMdnsScope can carry the complete usable address set for one adapter; give publications sharing a host name the same set, and withdraw their handles before changing it. For fallback addresses shown by the certificate page, explicit scopes contribute every usable address.
ITlsCaHttps.Configure selects the current certificate for each handshake in built-in CA and own-certificate modes; it does nothing when TlsCa does not supply a certificate.
| Setting | Effect |
|---|---|
TriggerGate:HttpsPort |
The HTTPS port. 9190 on the Windows service and 443 on the Uno build. 0 turns HTTPS off, which leaves only the plain HTTP port. |
TriggerGate:TlsStorageDirectory |
Where the CA and certificate are kept. See the paths above. |
TriggerGate:ServicePort |
The plain HTTP port. 9090 by default. |
Set these in the TriggerGate section of the service's appsettings.json, as command-line arguments (--TriggerGate:HttpsPort=0) or as environment variables (TriggerGate__HttpsPort=0). On the Uno build, the service reads environment variables from /etc/default/triggergate. The ESP32 board has no settings for this: it always serves HTTPS on port 443.
If it does not work¶
| What you see | Likely cause |
|---|---|
| A certificate warning | The address is not the secure address from the table (an IP address or the bare name), the CA is not installed on this computer or phone, the browser is Firefox and has not been given the certificate, or TriggerGate was reset and now has a new CA (compare the fingerprint). |
| "Not valid yet" or "expired" | The date on this computer or phone is wrong, or the certificate needs renewing. |
The .local name is not found |
This computer or phone cannot look up .local names, or the network blocks mDNS. Check from a computer on the same network segment as TriggerGate. |
| Nothing opens at all | TriggerGate is not running, or a firewall blocks the ports in the table. |
| The secure address opens a different device | Two devices share the name. See above. |
| Renew or Reset is refused | You are not at the device. See Renewal and reset. |
- The certificate page says the identity cannot be used. TriggerGate could not read the stored CA, for example after the Windows service's account was changed. The service keeps running, plain HTTP works, and HTTPS connections fail. On the Windows service, open the certificate page on the TriggerGate computer itself (
http://localhost:9090/.well-known/gameshowpro/) and use Reset identity, which creates a new CA. On the Uno build, do the same through an SSH tunnel, as described under Renewal and reset. Every computer and phone must then install the new certificate. - An ESP32 board serves no HTTPS and its certificate page says the identity cannot be used. The board could not read its stored identity, and it does not replace it by itself. Power-cycle the board, then use Reset identity on its certificate page within 5 minutes.
- An ESP32 board's web page does not finish loading. The board allows three HTTPS connections at once. Close other pages that are open on it and try again.
- The certificate page says the certificate is close to expiry (ESP32 board). The board never renews by itself. Power-cycle the board, then press Renew certificate on its certificate page within 5 minutes. Computers and phones that already trust the CA keep working.