Skip to content

fix: use platform TLS verifier for all HTTP clients#499

Open
kajogo777 wants to merge 2 commits intomainfrom
fix/warden-tls-platform-verifier
Open

fix: use platform TLS verifier for all HTTP clients#499
kajogo777 wants to merge 2 commits intomainfrom
fix/warden-tls-platform-verifier

Conversation

@kajogo777
Copy link
Member

Replace bare reqwest::Client::new() and reqwest::Client::builder().build() calls with platform-verified TLS clients that read the system CA store.

This fixes TLS interception failures in warden readonly mode where the custom CA certificate was not being trusted by HTTP clients using hardcoded webpki-roots.

Changes:

  • libs/ai/src/registry/models_dev.rs: Use create_platform_tls_client()
  • libs/shared/src/oauth/flow.rs: Remove reqwest::Client::new() fallback
  • libs/shared/src/oauth/providers/anthropic.rs: Remove fallback
  • libs/shared/src/models/integrations/search_service.rs: Remove fallback
  • cli/src/apikey_auth.rs: Remove fallback

The fallback to reqwest::Client::new() was problematic because it uses rustls with webpki-roots (hardcoded Mozilla CA roots), which doesn't include custom CAs installed in the system store.

Replace bare reqwest::Client::new() and reqwest::Client::builder().build()
calls with platform-verified TLS clients that read the system CA store.

This fixes TLS interception failures in warden readonly mode where the
custom CA certificate was not being trusted by HTTP clients using
hardcoded webpki-roots.

Changes:
- libs/ai/src/registry/models_dev.rs: Use create_platform_tls_client()
- libs/shared/src/oauth/flow.rs: Remove reqwest::Client::new() fallback
- libs/shared/src/oauth/providers/anthropic.rs: Remove fallback
- libs/shared/src/models/integrations/search_service.rs: Remove fallback
- cli/src/apikey_auth.rs: Remove fallback

The fallback to reqwest::Client::new() was problematic because it uses
rustls with webpki-roots (hardcoded Mozilla CA roots), which doesn't
include custom CAs installed in the system store.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahmedhesham6 will this be problematic?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs testing

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