fix: validate the server-presented chain in connect#190
Conversation
b14f38c to
6704355
Compare
There was a problem hiding this comment.
Pull request overview
This PR hardens certkit connect by validating against the server-presented certificate path (instead of allowing platform-assisted completion to mask missing intermediates), and adds a CLI flag to pin the negotiated TLS version for reproducible comparisons across TLS 1.2/1.3 presentation differences.
Changes:
- Enforce “presented-chain” path validation and refine AIA-related diagnostics/behavior in
ConnectTLS. - Add
--tls-versionparsing/plumbing to pin TLS 1.0–1.3, plus legacy-fallback version checks. - Add/adjust regression tests for TLS version pinning and incomplete/duplicated presented chains with AIA recovery.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
connect.go |
Adds presented-chain path validation helpers, TLS version pinning in config, and updated verification/AIA behavior. |
connect_test.go |
Adds TLS-version pin test and expands coverage for missing-intermediate/duplicate-leaf and AIA scenarios. |
cmd/certkit/connect.go |
Adds --tls-version flag + parsing and tweaks JSON trust-status handling for presented-chain failures. |
cmd/certkit/connect_test.go |
Adds unit tests for parseConnectTLSVersion and updates status-line consistency fixture. |
probe_legacy.go |
Ensures legacy fallback respects pinned TLS version and reports mismatch. |
README.md |
Documents the new --tls-version flag. |
go.mod / go.sum |
Dependency bumps (e.g., x/crypto, x/sys, modernc.org/sqlite, go-pkcs12). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6704355d54
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
6704355 to
3973933
Compare
|
@copilot review this pr |
All review comments from the automated review have been addressed in commit
All tests pass ( Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Summary
certkit connectverification against the server-presented certificate path rather than implicitly accepting platform-completed chains--tls-versionso TLS 1.2 and TLS 1.3 presentation can be compared directlyRepro
certkit connect --tls-version 1.2should validate when the peer presents a usable chaincertkit connect --tls-version 1.3should fail when the peer omits the required issuer pathValidation
go test ./...certkit connectchecks with pinned TLS 1.2 and TLS 1.3go1.26.2