fix(deps): update rcgen to 0.14#349
Conversation
rcgen 0.14 moved `CertificateParams::from_ca_cert_pem()` to `Issuer::from_ca_cert_pem()` and `signed_by()` now takes an `&Issuer` instead of separate cert + key args. Also switched the cached cert expiry check from rcgen params parsing to x509-parser directly. Closes #332 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR upgrades Confidence Score: 5/5Safe to merge — clean dependency upgrade with correct API migration and passing tests. All findings are P2 or lower. The rcgen 0.14 API is used correctly ( No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant TLS as TLS Connection (SNI)
participant SNI as SniCertResolver
participant L1 as L1 Memory Cache
participant L2 as L2 Disk Cache
participant rcgen as rcgen 0.14 (Issuer)
participant x509 as x509-parser
TLS->>SNI: resolve(domain)
SNI->>L1: check cache
alt cache hit
L1-->>SNI: CertifiedKey
else cache miss
SNI->>L2: load_from_disk(path)
alt disk hit
L2->>x509: parse_x509_certificate(der)
x509-->>L2: validity.not_after.timestamp()
alt not expired
L2-->>SNI: CertifiedKey
else expired
L2-->>SNI: Err (regenerate)
end
end
SNI->>rcgen: CertificateParams::signed_by(&leaf_key, &issuer)
note over rcgen: Issuer loaded via Issuer::from_ca_cert_pem() at startup
rcgen-->>SNI: leaf Certificate
SNI->>L1: insert(domain, CertifiedKey)
SNI->>L2: persist combined PEM (0600)
end
SNI-->>TLS: CertifiedKey
Reviews (1): Last reviewed commit: "fix(deps): update rcgen to 0.14" | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request updates several dependencies, including an upgrade of rcgen to version 0.14 and the addition of x509-parser. The SniCertResolver has been refactored to use the rcgen::Issuer type, which simplifies CA loading and leaf certificate signing. Additionally, the manual PEM parsing previously used for certificate expiry checks has been replaced with x509-parser. Feedback is provided regarding the error handling of the x509_parser result to ensure more descriptive error messages in the event of a parsing failure.
| let (_, cert) = x509_parser::parse_x509_certificate(&cert_ders[0]).map_err(|e| { | ||
| miette::miette!("Failed to parse certificate from {}: {e}", path.display()) | ||
| })?; |
There was a problem hiding this comment.
The x509_parser::parse_x509_certificate function returns a nom::IResult, which contains a tuple of the remaining input and the parsed certificate. While ignoring the remaining input is acceptable here, the error type returned by nom parsers is nom::Err<X509Error>. To provide a more descriptive error message in the miette report, you might want to explicitly handle the nom::Err variants or ensure that the Display implementation of the error provides enough context.
## 🤖 New release * `pitchfork-cli`: 2.5.0 -> 2.6.0 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [2.6.0](v2.5.0...v2.6.0) - 2026-04-12 ### Added - *(proxy)* auto start when visiting the proxied URL ([#347](#347)) ### Fixed - some issues related to sudo supervisor ([#323](#323)) - *(port)* should fail when ready_port is in use ([#350](#350)) - *(deps)* update rcgen to 0.14 ([#349](#349)) - *(deps)* update reqwest to 0.13 ([#348](#348)) - detect port conflicts on loopback addresses, not just 0.0.0.0 ([#345](#345)) - narrow REAPED_STATUSES cfg to non-Linux unix only ([#346](#346)) - *(deps)* update rust crate ratatui to 0.30 ([#331](#331)) - *(deps)* update rust crate toml to v1 ([#344](#344)) - *(deps)* update rust crate strum to 0.28 ([#334](#334)) - *(deps)* update rust crate notify-debouncer-full to 0.7 ([#330](#330)) - *(deps)* update rust crate nix to 0.31 ([#329](#329)) - *(deps)* update rust crate listeners to 0.5 ([#328](#328)) - *(deps)* update rust crate sysinfo to 0.38 ([#335](#335)) - *(deps)* update rust crate cron to 0.16 ([#324](#324)) - *(deps)* update rust crate crossterm to 0.29 ([#325](#325)) ### Other - *(deps)* update rust crate rmcp to v1.4.0 ([#327](#327)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: this PR only bumps the crate version and updates release notes, with no runtime code changes. > > **Overview** > Prepares the `pitchfork-cli` **v2.6.0** release by bumping the package version from `2.5.0` to `2.6.0` in `Cargo.toml`/`Cargo.lock`. > > Updates `CHANGELOG.md` with the `2.6.0` release notes (proxy auto-start behavior, several fixes, and dependency updates). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit faea6c5. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Summary
CertificateParams::from_ca_cert_pem()toIssuer::from_ca_cert_pem()(rcgen 0.14 moved issuer logic into a dedicatedIssuertype)signed_by()now takes&Issuerinstead of separate&Certificate+&KeyPairargsCertificateParams::from_ca_cert_pemCloses #332
Test plan
cargo buildsucceedscargo nextest run— 400 passed, 0 failedtest_e2e_proxytests🤖 Generated with Claude Code
Note
Medium Risk
Medium risk because it changes on-the-fly TLS certificate signing and cached-cert validation logic in the proxy, which could break HTTPS interception if parsing/signing behavior differs. Dependency upgrades in the ASN.1/X.509 stack may also affect certificate handling edge cases.
Overview
Upgrades the proxy TLS stack to
rcgen0.14and updates the SNI cert resolver to usercgen::Issuerfor CA-based leaf signing (replacing the previous reconstructedCertificate+KeyPairissuer flow).Adds
x509-parserto theproxy-tlsfeature and switches the on-disk cached certificate expiry check to parse the first cert’snot_afterdirectly viax509-parser, avoiding removed/changedrcgenAPIs. Lockfile updates reflect the bumped ASN.1/X.509-related transitive dependencies (asn1-rs,der-parser,oid-registry,x509-parser).Reviewed by Cursor Bugbot for commit b485fd2. Bugbot is set up for automated code reviews on this repo. Configure here.