feat: send over TLS instead of plain TCP - #61
Merged
Merged
Conversation
|
Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
Comment |
Contributor
Author
|
@coderabbitai pause |
DavidCozens
force-pushed
the
stage-13-tls
branch
from
August 16, 2026 09:15
c0e721e to
55d7a7f
Compare
✅ Action performedReviews paused. |
DavidCozens
force-pushed
the
stage-12-origin-ip
branch
from
August 16, 2026 17:57
6dd39b1 to
d3d292e
Compare
Contributor
Author
|
@coderabbitai pause |
An mbedTLS stream wrapping the lwIP TCP stream, and the collector moves to 6514. Server authentication only: the device verifies the collector against the trust anchor it already holds and presents nothing of its own. Flash +13,084 B (+704 on the previous stage) RAM +37,452 B (+28,280) mbedTLS peak +14,660 B (35,992 absolute) Log stack +680 B (unchanged) Service +3,768 B (+2,808) Only 632 bytes of the RAM is the library. The rest is a second concurrent session upstream: the mbedTLS pool grows 32 -> 53 KiB and the service seam 2 -> 8 KiB. Likewise the flash, which measures the code that drives TLS rather than TLS itself — a device already speaking mTLS was carrying mbedTLS long before SolidSyslog arrived. Both resizes were forced by the device and both failed loudly. The pool was sized for the broker session alone, so the handshake could not allocate: MbedTlsStream category 0x0402, repeatedly, and nothing reached the collector. Given room, the handshake then overflowed the service seam, which takes the device down before it can report — so neither figure can be read from the run that fails. The pool follows this device's existing rule, the measured peak times 1.5 rounded up to the next KiB. The service seam is generous for now and comes back with the rest at the end. The TLS stream takes the trust anchor and DRBG as handles at create time, not paths or PEM, so the device's crypto is initialised before the scheduler starts. ServerName is checked against the collector's certificate. The drain window covers a connect and handshake rather than a datagram. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
DavidCozens
force-pushed
the
stage-13-tls
branch
from
August 16, 2026 17:57
55d7a7f to
4313c9f
Compare
✅ Action performedReviews paused. |
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.
Wrap the byte stream in TLS, layered over the TCP stream from the previous stage. The device verifies
the collector against a trust anchor it already holds, so records can be read only by that collector
and cannot be altered in transit. The collector is authenticated to the device; the device is not yet
authenticated to the collector.
ServerNameis checked against the collector's certificate, so it has to match a name thatcertificate carries. The trust anchor and the DRBG are passed as handles rather than paths or PEM, so
the device's crypto is initialised before the scheduler starts.
A second concurrent session has to be paid for upstream. The mbedTLS allocator and the task that
carries the handshake both need sizing for it; both fail loudly when they are not, and neither can be
sized from the run that fails.