feat: wire --insecure flag to HTTPS cert verification#12
Conversation
Bump moonbitlang/async 0.16.0 → 0.17.1 (ships the verify~ parameter on @http.Client::new) and mizchi/tui 0.9.0 → 0.9.1 (which relaxed its async pin to allow 0.17.x). Pass verify~=!config.insecure at all three @http.Client::new sites in worker.mbt so the existing --insecure CLI flag actually reaches the TLS layer instead of silently no-op'ing. Also adapt to async 0.17.0 breaking changes in coordinator_test.mbt: @http.Server::new became async (start_server now async fn), and the .addr() getter is deprecated in favor of the .addr field. Verified: moon check clean, moon fmt clean, moon test --target native 250/250 passed, release binary 2.5M. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12 +/- ##
==========================================
- Coverage 62.73% 62.48% -0.26%
==========================================
Files 16 16
Lines 730 733 +3
==========================================
Hits 458 458
- Misses 272 275 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Previously --debug used @http.get(uri) — a module-level helper that doesn't accept verify~, so -k silently failed even after the main load-test path honored it. Route debug through Client::new with verify~=!config.insecure so both code paths behave consistently. - Expose worker.parse_url as pub for reuse from main.mbt - Import moonbitlang/async/io aliased as @async_io to avoid name collision with the existing mizchi/tui/io @io alias - Read body via (client : &@async_io.Reader).read_all() since Client::get returns only Response (not (Response, &@io.Data) like the module-level helper) Manual verification against https://self-signed.badssl.com: - molt --debug https://... → TlsError (expected) - molt --debug -k https://... → 200 OK + body (expected) - molt -n 1 https://... → 50 failed with TlsError - molt -n 1 -k https://... → 55 succeeded with 200 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Follow-up: debug mode also wired to `--insecure`Manual verification against `https://self-signed.badssl.com\` surfaced a gap: `--debug` used the module-level `@http.get(uri)` helper, which doesn't accept `verify~`. So `molt --debug -k https://self-signed.badssl.com\` still failed with `TlsError` even after the worker path was fixed. Pushed `fc9c881` to route debug mode through `@http.Client::new(base_url, verify~=!config.insecure)` as well. Both paths now behave consistently. Verification matrix
Implementation notes
Test plan (updated)
|
Summary
Why now
`moonbitlang/async` v0.17.1 (2026-04-10) finally shipped the `verify?: Bool = true` parameter that resolves moonbitlang/async#329. `mizchi/tui` v0.9.1 (same day) relaxed its transitive pin via mizchi/tui.mbt#9 so molt can actually consume it — MoonBit's resolver doesn't allow two versions of the same module in the graph, and tui was previously hard-pinning async at 0.16.6.
Test plan
Notes for reviewers
🤖 Generated with Claude Code