Skip to content

UPSTREAM PR #17458: fix(http): apply TLS certificate verification to connection pool#37

Open
loci-dev wants to merge 1 commit intomainfrom
loci/pr-17458-fix-http-pool-tls-verification
Open

UPSTREAM PR #17458: fix(http): apply TLS certificate verification to connection pool#37
loci-dev wants to merge 1 commit intomainfrom
loci/pr-17458-fix-http-pool-tls-verification

Conversation

@loci-dev
Copy link

@loci-dev loci-dev commented Feb 2, 2026

Note

Source pull request: nushell/nushell#17458

Description

The http_client_pool() function was missing TLS configuration, causing pooled HTTPS connections (via --pool flag) to not verify certificates. This fix aligns the pooled client behavior with the regular http_client() which properly applies tls_config().

Changes:

  • Adds tls_config(false) to enable certificate verification by default
  • Changes return type to Result<Arc<Agent>, ShellError> to handle potential TLS initialization errors
  • Updates all call sites to propagate errors with ?

Background: I asked Claude to review the nushell HTTP code. It identified this inconsistency and implemented the fix. I don't have deep Rust expertise, so I'd appreciate review from maintainers familiar with this area.

User-Facing Changes

Users of http get --pool, http post --pool, etc. will now have TLS certificate verification enabled by default, matching the behavior of non-pooled requests.

Tests + Formatting

  • cargo fmt --all -- --check passes
  • cargo clippy --workspace -- -D warnings -D clippy::unwrap_used passes

After Submitting

N/A


Release notes summary

Fixed an inconsistency where http commands with --pool flag were not applying TLS certificate verification. Pooled HTTPS connections now properly validate certificates, matching the behavior of regular (non-pooled) requests.

The http_client_pool() function was missing TLS configuration, causing
pooled HTTPS connections (via --pool flag) to potentially skip
certificate verification. This differs from http_client() which
properly applies tls_config().

This fix:
- Adds tls_config(false) to enable certificate verification by default
- Changes return type to Result<Arc<Agent>, ShellError> to handle
  potential TLS initialization errors
- Updates all call sites to propagate errors

Security impact: Without this fix, `http get --pool https://...` could
connect to servers with invalid certificates without warning, enabling
potential MITM attacks.

Users who need to disable verification for pooled connections should
use `http pool --insecure` to explicitly reset the pool.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@loci-dev loci-dev force-pushed the main branch 22 times, most recently from da22582 to 3f38f88 Compare February 3, 2026 13:30
@loci-dev loci-dev force-pushed the main branch 6 times, most recently from cd989c3 to 64bcc48 Compare February 15, 2026 03:31
@loci-dev loci-dev force-pushed the main branch 3 times, most recently from 6102c29 to d8ed90c Compare February 19, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments