Commit 746488f
feat(mqtt-connector): TLS, auth, and SNTP time source for the Embassy client
Implements design 044: mqtts:// broker support behind a new embassy-tls
feature.
- embedded-tls 1.3 session over the Embassy TCP socket; rustpki (pure
Rust, rsa+p384) certificate verification against an app-embedded root
CA; SNI + hostname verification from the broker URL (IP-literal mqtts
URLs are rejected at build()).
- Entropy injected via TlsOptions (&'static mut dyn CryptoRngCore) — the
app owns the TRNG; buffers are app-provided statics (D3, D10).
- Connector-internal SNTPv4 task (UDP + DNS) backs the TlsClock; the
first handshake waits for time sync so validity is always checked (D4,
D5). The wire codec is feature-independent and host-tested.
- The TLS manager loop is a connector-local port of
mountain-mqtt-embassy's run() (which hard-codes a plain TcpSocket);
the session speaks a custom Connection impl tracking decrypted
plaintext + socket readiness, and re-subscribes inbound routes per
session. The plain path is untouched (D6).
- with_credentials() feeds MQTT CONNECT on both transports; the fork
submodule gains upstream 0.4's ConnectionSettings::with_auth/
authenticated (aimdb-dev/mountain-mqtt@89a7129) (D8).
- make check gains the embassy-runtime,embassy-tls,defmt clippy leg.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 9f0dbf8 commit 746488f
9 files changed
Lines changed: 1583 additions & 45 deletions
File tree
- _external
- aimdb-mqtt-connector
- src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
| 256 | + | |
255 | 257 | | |
256 | 258 | | |
257 | 259 | | |
| |||
Submodule mountain-mqtt updated 1 file
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
41 | 53 | | |
42 | 54 | | |
43 | 55 | | |
| |||
84 | 96 | | |
85 | 97 | | |
86 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
87 | 108 | | |
88 | 109 | | |
89 | 110 | | |
| |||
0 commit comments