REQUESTS_CA_BUNDLE is an environment variable used by Python HTTP clients to specify a custom CA certificate bundle. It tells the client which certificate chain to trust when validating server certificates over TLS, overriding the default system trust store for those requests.
What REQUESTS_CA_BUNDLE changes in TLS trust
REQUESTS_CA_BUNDLE changes the trust anchor a Python HTTP client uses when it validates a server certificate. Instead of relying only on the operating system trust store, the client can be pointed at a specific CA bundle, which is useful when an organisation issues private certificates, intercepts traffic with an approved proxy, or needs a controlled trust path for a given application.
This is not just a convenience setting. It changes which certificate chains the client will accept, so the bundle becomes part of the security boundary for outbound HTTPS connections. If the bundle is wrong, stale, or too broad, the client may trust servers it should not, or fail to trust the servers it does need.
Why custom CA bundles are used
Many enterprise environments terminate or inspect TLS at a corporate proxy, use private internal certificate authorities, or distribute a managed trust bundle to development and CI systems. In those cases, the custom bundle lets the client verify the proxy or internal service without disabling certificate checks.
The safer pattern is to trust a managed CA bundle, not to weaken verification. That distinction matters because developers often reach for broad bypasses when certificate validation fails. A custom bundle preserves validation, while turning verification off removes it.
In practice, this variable is often part of a larger trust-management design that includes certificate distribution, rotation, and environment-specific configuration. A well-governed bundle should be treated like security configuration, not an ad hoc developer workaround.
For a practical example of how controlled trust bundles are used across common tooling, see How to make developer tools trust a TLS-inspecting corporate proxy safely.
How misuse weakens TLS assurance
The main danger is not the existence of a custom bundle, but how it is sourced and maintained. If the bundle is over-permissive, contains unexpected roots, or is copied from an untrusted location, the client may accept certificates outside the organisation’s intended trust model.
That failure mode is especially serious when teams confuse “make it work” with “make it trustworthy.” An environment variable can override the normal trust store for one process, but it also makes that process dependent on the integrity of the configured bundle and the environment that supplied it.
Used carelessly, this setting can create silent trust expansion, brittle builds, or hidden dependence on local developer machines. Used well, it lets teams preserve certificate validation while accommodating private trust infrastructure.
Where it fits in secure application configuration
REQUESTS_CA_BUNDLE belongs in the category of security-sensitive runtime configuration. It should be set deliberately, documented, and scoped to the application or environment that actually needs it. That reduces the chance that a global shell setting changes trust behaviour for unrelated tools.
It also helps to separate trust configuration from application logic. When certificate trust is externalised cleanly, teams can update CA material without code changes, and they can review trust decisions as part of deployment or platform configuration rather than as hidden behaviour in the client library.
For readers who want the protocol-side background on certificate chains and trust bundles, the SPIFFE workload identity specification is a useful reference point for how trust bundles are distributed and validated in modern systems.
Operational checks before you rely on it
Before using this variable, confirm that the bundle you point to is the one your security team expects, that it is distributed through a controlled path, and that it is appropriate for the environment in which the client runs. The same setting should not silently drift between developer laptops, CI runners, and production jobs.
When TLS validation problems appear, the first question should be whether the client is using the intended trust bundle, not whether certificate checks should be disabled. That discipline keeps the control in the trust layer, where it belongs.
If the variable is part of a broader platform pattern, align it with your trust-store governance and your certificate lifecycle processes so that trust changes remain reviewable and reversible.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST SP 800-53 Rev 5 and CIS Controls v8 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | SC-8 — Transmission Confidentiality and Integrity | TLS trust bundle choice directly affects validated protection of HTTPS traffic. |
| CM-6 — Configuration Settings | The variable is a security-relevant configuration that changes client trust behavior. | |
| IA-5 — Authenticator Management | CA bundles are identity-verification material used to validate server certificates. | |
| Recommendation — Validate outbound TLS with approved trust material and reject ad hoc verification bypasses. Standardize and review runtime trust settings for applications and deployment environments. Manage certificate trust material with controlled distribution, rotation, and removal. | ||
| ISO/IEC 27001:2022 | A.8.24 — Use of cryptography | Custom CA bundles govern certificate-based trust used in encrypted connections. |
| Recommendation — Define approved trust bundles and control their distribution within cryptographic configurations. | ||
| CIS Controls v8 | CIS-4 — Secure Configuration of Enterprise Assets and Software | The setting is a configuration control that can weaken or harden TLS verification. |
| Recommendation — Harden client configuration so only approved CA bundles are used for outbound TLS. | ||
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org