feat(grpc): encrypt the control channel with server-side TLS - #120
Merged
Conversation
antoncxx
force-pushed
the
grpc-control-channel-tls
branch
3 times, most recently
from
July 20, 2026 21:28
ba32d37 to
bc48083
Compare
antoncxx
marked this pull request as ready for review
July 20, 2026 21:53
antoncxx
force-pushed
the
grpc-control-channel-tls
branch
3 times, most recently
from
July 21, 2026 23:28
3d8f346 to
d339266
Compare
Member
|
@antoncxx is there a way we can simplify the configurations ( We're moving towards getting centralised on the server, and before next week deployment it'd be ideal to have the least friction possible. |
A leftover leaf cert with no matching CA (e.g. from a pre-CA build of this feature) was being silently reused forever, so ca-cert.pem never got generated. Now the leaf is cryptographically verified against the persisted CA (issuer/subject match, signature, expiry) before reuse; any mismatch regenerates just the leaf, reusing the existing CA so client pins keep working.
antoncxx
force-pushed
the
grpc-control-channel-tls
branch
from
July 24, 2026 03:14
9db5055 to
17dbfdd
Compare
Client/proxy no longer hard-require the env var — if unset they fall back to ca-cert.pem in the working directory and only fail once they actually try to read it (missing file or invalid cert), instead of refusing to start over an unset variable that already has a sane default.
Contributor
Author
|
Client/proxy no longer hard-require the env var — if unset they fall back to ca-cert.pem in the working directory and only fail once they actually try to read it |
GyulyVGC
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On first boot, the control server now generates its own private CA
(
members/nullnet-server/grpc-tls/ca-cert.pem+ca-key.pem, created onceand never regenerated) and signs its gRPC TLS leaf cert with it. Copy
ca-cert.pemto every client/proxy host and setCONTROL_SERVICE_CA_CERTthere — it's required: clients pin the channel to that CA and do full
standard chain validation (including hostname matching), so only a leaf
actually signed by it is accepted. Because clients trust the stable CA root
rather than the leaf, rotating the leaf later needs no client-side changes.
The leaf's SAN (needed for hostname validation) is derived in order:
CONTROL_SERVICE_TLS_SAN(explicit override) → the server's ownCONTROL_SERVICE_ADDR(often already the right value) →localhost.On every boot, a persisted leaf is only reused if it actually verifies
against the persisted CA — issuer/subject match, signature, and expiry are
all checked cryptographically, not just "do the files exist." This catches
a stale leaf left over from an earlier iteration of this feature (before it
signed with a CA at all), or any other corruption/mismatch, and
regenerates just the leaf while keeping the existing CA intact — so
already-distributed client pins keep working.
Known limitation: client authentication (mTLS) remains a follow-up —
the server doesn't yet verify who's connecting, only the reverse.