Repository navigation
Conversation
nbox builds reqwest with the bundled Mozilla root store, which contains no private CAs, so a NetBox served by an internal/enterprise CA fails with `invalid peer certificate: UnknownIssuer`. The only existing escape hatch was `verify_tls = false`. That hatch is too blunt: disabling verification accepts *any* certificate, which would expose the NetBox token to anyone able to intercept the connection. Add `[profiles.<name>].ca_bundle`, a PEM file whose certificates are *added* to the default roots — the certificate still has to verify. A bundle that cannot be read, or that parses to zero certificates, is an error at client construction. The alternative is building a client with no extra roots and surfacing a confusing `UnknownIssuer` at the first request, far from the typo that caused it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
nbox builds reqwest with the bundled Mozilla root store, which contains no private CAs. A NetBox served by an internal/enterprise CA therefore fails with
invalid peer certificate: UnknownIssuer. The only escape hatch wasverify_tls = false— an all-or-nothing switch that disables verification altogether and would expose the NetBox token to anyone able to intercept the connection.Change
[profiles.<name>].ca_bundle = "/path/ca.pem"— a PEM file (may hold the whole chain) whose certificates are added to the default roots. The certificate still has to verify; nothing is replaced or switched off.Fail-fast: a bundle that cannot be read, or that parses to zero certificates, is an error at client construction — not a silently unverified connection at the first request, far from the typo that caused it.
Docs updated where
verify_tls = falsewas previously the only advice (README, CONFIG, TROUBLESHOOTING, examples/config.toml): prefer trust anchors, keepverify_tls = falseas the lab-only last resort.Checks
cargo fmt --all -- --checkclean;cargo clippy --all-targets --all-features -D warningsclean;cargo buildclean;cargo test --all-features1384 passed / 0 failed (25 binaries; the +3 over master are the new ca_bundle unit tests: bundle added to roots, unreadable bundle errors, empty bundle errors). Run on Rust 1.98, what upstream CI'sdtolnay/rust-toolchain@stablecurrently resolves to.