Repository navigation
Signaling TLS
MiNET can serve its NetherNet signaling port over TLS, using a certificate it obtains and renews by itself from Let's Encrypt. The feature is off by default and needs three lines of configuration and one port forward to turn on.
NetherNet signaling is a single HTTP round trip on a TCP port (default 19132): the client asks GET /v1/join, then posts its WebRTC offer, and everything after that is encrypted WebRTC. The signaling round trip itself, however, is plain HTTP, and the offer carries identity JWTs in the clear.
The Bedrock client actually tries TLS first on this port before falling back to plaintext. Vanilla BDS always refuses that offer, and MiNET historically mirrored the refusal. With this feature enabled, MiNET answers the offer instead: it completes the TLS handshake with a real, publicly trusted certificate for your server's domain.
The certificate side is fully automatic. MiNET speaks ACME (the Let's Encrypt protocol, RFC 8555) natively, with no external tools, no certbot, and no manual renewals. It orders a certificate on first start, stores it next to the server, and renews it when fewer than 30 days remain.
A note on current clients: retail Bedrock clients today complete the TLS handshake, then close the connection and continue over plaintext anyway. The plaintext path is untouched, so joins work exactly as before. The feature exists so the server is already answering correctly the day clients start following through, and the log shows exactly what each client did with the offer.
Every TCP connection to the signaling port is peeked before it is read. A plain HTTP request passes straight through. A TLS ClientHello is answered with the certificate when the client's SNI matches the configured domain, or, since real Bedrock clients send no SNI at all, when the connection's source shows the client dialled the server's external address (it arrives from a public address, or from the NAT gateway in the hairpin case). Anything else gets the same fatal handshake_failure alert BDS sends, which is what makes the client retry in the clear.
flowchart TD
A[TCP connection on signaling port] --> B{First byte a<br/>TLS record?}
B -- no --> C[Plain HTTP<br/>signaling as always]
B -- yes --> D{SNI matches<br/>configured domain?}
D -- yes --> E[Complete TLS handshake<br/>serve signaling over TLS]
D -- "no SNI (real clients)" --> F{Source is public or<br/>the NAT gateway?}
F -- yes --> E
F -- no --> G[Refuse with handshake_failure<br/>like BDS does]
G --> H[Client retries in plaintext]
H --> C
The refusal branch is not an error path, it is the compatibility path: LAN clients, tools, and today's retail clients all end up on plain HTTP exactly as they always did.
The ACME client is built into MiNET (BCL cryptography only). Validation uses HTTP-01: Let's Encrypt connects to port 80 of your domain and asks for a token, and MiNET's own signaling port answers it, so the only infrastructure needed is a route from external port 80 to the signaling port.
Before any order is placed, MiNET preflights its own plumbing: it registers a throwaway token and dials http://your.domain/.well-known/acme-challenge/... itself. Only if its own answer comes back does it contact Let's Encrypt. This matters because Let's Encrypt rate-limits failed validations, and a misrouted port 80 would otherwise burn that budget every hour.
sequenceDiagram
participant M as AcmeCertificateManager
participant S as Signaling port (19132)
participant R as Router / firewall<br/>(80 → 19132)
participant LE as Let's Encrypt
Note over M: hourly check:<br/>cert missing or < 30 days left?
M->>R: GET http://domain/.well-known/acme-challenge/probe
R->>S: forwarded to signaling
S-->>M: probe value (preflight OK)
M->>LE: new order for the domain
LE-->>M: http-01 challenge token
M->>M: register token on the challenge route
M->>LE: validate now
LE->>R: GET /.well-known/acme-challenge/token (port 80)
R->>S: forwarded to signaling
S-->>LE: key authorization
M->>LE: finalize with CSR
LE-->>M: certificate chain (PEM)
M->>M: write PEMs, load, serve
Renewal is the same flow, triggered automatically inside the last 30 days of a certificate's 90-day life. A quiet hourly check costs one date comparison and no network traffic.
Everything lives in server.conf. The feature is off unless SignalingTls.Enabled says otherwise.
# TLS on the signaling port, with automatic Let's Encrypt certificates.
SignalingTls.Enabled=true
SignalingDomain=play.example.com
AcmeContactEmail=admin@example.com
| Key | Default | Meaning |
|---|---|---|
SignalingTls.Enabled |
false |
The master switch. Off means no TLS is served and no certificate authority is ever contacted. |
SignalingDomain |
empty | The domain the certificate is issued for. Must resolve to your server. Required when enabled. |
SignalingCertificateDirectory |
certificates |
Where the PEM files live, relative to the working directory unless absolute. |
AcmeContactEmail |
empty | Optional contact for the Let's Encrypt account (expiry mail, incident notices). |
AcmeStaging |
false |
Order from Let's Encrypt's staging environment instead. Staging certificates are not publicly trusted; use this only to test the plumbing without touching production rate limits. |
Let's Encrypt validates on port 80 of the domain, always. Route external TCP 80 to the signaling port and everything works:
- Home router: forward external port 80 to the machine's signaling port (19132 by default).
- Linux with the port on the same box: a NAT redirect, for example with iptables:
-A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 19132. Note that the server's own preflight dials its public address too, and locally generated traffic skips PREROUTING, so add the same redirect on the nat OUTPUT chain for the machine's public IP.
If the route is missing, nothing bad happens: the preflight fails, MiNET logs a warning, skips the order, and retries the next hour.
Three PEM files per domain in the certificate directory, all named after the domain:
certificates/
play.example.com.account.pem # the ACME account key (the Let's Encrypt identity)
play.example.com.cert.pem # the certificate chain
play.example.com.key.pem # the certificate's private key
Keep this directory out of version control; the key files are secrets. Losing the directory is recoverable (MiNET simply orders again), but reissuing repeatedly runs into Let's Encrypt's limit of 5 duplicate certificates per week.
The signaling log tells the whole story per connection:
INFO ... TLS offer from 203.0.113.7: versions=[1.3,1.2] ciphers=20 alpn=[h2,http/1.1] sni=absent ...
INFO ... TLS established (SNI absent, source 203.0.113.7): Tls13, cipher TLS_AES_256_GCM_SHA384, alpn http/1.1
INFO ... TLS connection from 203.0.113.7 closed cleanly (close_notify) without sending a request
That last line is today's retail client: handshake completed, channel abandoned, plaintext retry follows. When a client version starts using the channel, the same log will show its /v1/join arriving over TLS instead, with no server change needed.
On the certificate side:
INFO [AcmeCertificateManager] - Ordering a certificate for play.example.com from Let's Encrypt
INFO [AcmeCertificateManager] - Certificate for play.example.com issued, valid to 2026-11-14
A quick external check that everything is live, from any machine with curl:
curl -v https://play.example.com:19132/v1/join
A 200 with a valid certificate chain means the port serves TLS with the real certificate.