NewTLSConfig parses CA bundle even when insecure is set #599

Closed
opened 2026-08-08 05:09:28 +00:00 by the.auditor · 1 comment
Owner

NewTLSConfig in internal/tpagectl/client/client.go reads and validates the CA bundle file whenever caCertFile is non-empty, even when insecure is also true. As a result tpagectl --insecure --ca-cert <missing-or-empty-file> ... fails on the CA load despite TLS verification being disabled (and the CA being pointless).

When insecure is set, skip the CA file handling (or document that the two flags are mutually exclusive).

See #597

`NewTLSConfig` in `internal/tpagectl/client/client.go` reads and validates the CA bundle file whenever `caCertFile` is non-empty, even when `insecure` is also true. As a result `tpagectl --insecure --ca-cert <missing-or-empty-file> ...` fails on the CA load despite TLS verification being disabled (and the CA being pointless). When `insecure` is set, skip the CA file handling (or document that the two flags are mutually exclusive). See https://git.lan.thwap.org/thwap/thwap-pagesd/pulls/597
Owner

Fixed in #634: NewTLSConfig returns InsecureSkipVerify: true immediately when --insecure is set, ignoring any CA bundle (test added).

Fixed in #634: `NewTLSConfig` returns `InsecureSkipVerify: true` immediately when `--insecure` is set, ignoring any CA bundle (test added).
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/thwap-pagesd#599
No description provided.