WS-I: native TLS (optional, default off) with SIGHUP cert reload
server.tls.{enabled,cert_file,key_file}; rustls (ring, explicit provider) via
tokio-rustls + hyper-util; https:// MCP origins when enabled; non-loopback
plain-HTTP startup warning; tests/tls.rs; README TLS section.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c83a5fa1ac
commit
c5972b762f
11 files changed
+835
-15
No files matched your search
+1
-1
@@ -58,4 +58,4 @@ Move a card by cutting its row into another column. Keep the card's own **Status
|
||||
| M2 Surfaces | Verification #3, #4 and #5 pass | 🟨 #3 and #4 verified live on 2026-10-15; #5 (OTel smoke test) not run, no otelcol-contrib binary |
|
||||
| M3 Release | Verification #1–#6 pass. Unit file and README shipped. | ⬜ |
|
||||
| M4 NixOS | `nix flake check` passes including the VM test. `:1984` serves and a token is minted with the system-installed CLI. | ⬜ |
|
||||
| M5 TLS | HTTPS serves REST and `/mcp`, SIGHUP reloads certs, no openssl. | ⬜ |
|
||||
| M5 TLS | HTTPS serves REST and `/mcp`, SIGHUP reloads certs, no openssl. Verified on `ws-i/tls` (unmerged). | ✅ |
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
| Field | Value |
|
||||
|---|---|
|
||||
| Status | Backlog |
|
||||
| Status | Done on `ws-i/tls` (not merged) |
|
||||
| Owner | — |
|
||||
| Phase | 4 (single track, after P3, before WS-H) |
|
||||
| Depends on | P3 |
|
||||
@@ -39,3 +39,4 @@ Tick these in [`TODO.md`](../../TODO.md).
|
||||
## Log
|
||||
|
||||
- 2026-10-16: Card created from design discussion.
|
||||
- 2026-10-16: Implemented on `ws-i/tls`, T1-T8 done. **TLS is optional, default off** (user requirement): with `server.tls.enabled = false` the plain path is unchanged, the cert/key paths are ignored and never read, no rustls code runs, no provider is built, MCP origins stay `http://`; env (`SKYG_SERVER__TLS__*`) and `--print-config` cover the block. Design: `src/tls.rs` uses `tokio-rustls` + `hyper-util` (auto builder, HTTP/1.1 ALPN) with an accept loop and a `ReloadableCert` (`ResolvesServerCert` behind an RwLock) so SIGHUP swaps the cert for new handshakes without touching live connections; a bad pair logs an error and keeps the old one. The `ring` provider is passed explicitly to `ServerConfig::builder_with_provider`; no process-wide default is installed (aws-lc-rs was already in the tree via reqwest/OTLP; this adds no new provider or openssl). Cargo.toml: rustls, tokio-rustls, hyper-util (separate commit), rcgen dev-dependency. Shutdown: accept stops, each connection gets `graceful_shutdown`, bounded by the existing 10s drain (test: SIGTERM with an idle keep-alive and an open SSE stream over TLS exits 0). T5 warning is logged only when TLS is off and bind is non-loopback. Tests: 3 new unit tests (config validation, env, origins) and 8 in `tests/tls.rs`. Live check (debug binary, openssl-generated certs, curl): healthz, 401/200 REST, MCP initialize over HTTPS, plain HTTP rejected, SIGHUP changed the served fingerprint, a junk cert + SIGHUP kept the rotated one, SIGTERM exit 0.
|
||||
Reference in new issue
Block a user