fix httpx client mount verify setting #5632#5635
Conversation
CodSpeed Performance ReportMerging #5635 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Greptile Summary
This PR fixes an SSL verification inconsistency in Reflex's HTTPX client configuration. The issue was that when the SSL_NO_VERIFY=1 environment variable is set, the main HTTP transport correctly disables SSL verification, but proxy mounts were still enforcing SSL certificate verification. This inconsistency caused SSL certificate errors in proxy environments, particularly during reflex init commands.
The fix is elegantly simple: it extracts the SSL verification setting once using _httpx_verify_kwarg() and applies it consistently to both the main HTTP transport and all proxy mounts in the get_httpx_client() function. Previously, the main transport used verify=_httpx_verify_kwarg() while proxy mounts used the default verification behavior.
This change integrates well with Reflex's existing network utilities in reflex/utils/net.py, which already handles environment-based SSL configuration through the _httpx_verify_kwarg() helper function. The fix ensures that all HTTP transports (main and proxy) respect the same SSL verification policy, making the behavior predictable and consistent across different network environments.
Confidence score: 4/5
- This is a safe and well-targeted bug fix that addresses a clear inconsistency issue.
- The change is minimal, focused, and maintains backward compatibility while fixing the specific SSL verification problem.
- No files need additional attention as the change is straightforward and contained.
1 file reviewed, no comments
All Submissions:
Type of change
Changes To Core Features:
Title: Fix SSL Verification Inconsistency in HTTPX Client Proxy Mounts
Description:
This pull request addresses an inconsistency in SSL verification settings within the HTTPX client configuration used by Reflex. Currently, when the environment variable
SSL_NO_VERIFY=1is set, the main HTTP transport correctly disables SSL verification, but proxy mounts continue to enforce SSL certificate verification. This leads to inconsistent behavior and potential SSL certificate errors in environments using proxies, such as corporate networks with self-signed certificates, development setups, CI/CD pipelines, or networks with SSL inspection.The changes ensure that SSL verification settings are uniformly applied across both the main HTTP transport and proxy mounts, resolving errors like those encountered during
reflex initwhenSSL_NO_VERIFY=1is set. This fix enhances reliability in the following scenarios:Changes Made:
SSL_NO_VERIFYsetting to proxy mounts.Testing:
SSL_NO_VERIFY=1.closes #5632