← Back to Pull requests

fix: use cibuildwheel's CA bundle in cross venvs #3020

Closed
unknown closed this pull request without merging on Oct 22, 2026 13:18 UTC
View on GitHub
unknown unknown commented on Oct 21, 2026 15:49 UTC
Author

:robot: _AI text below_ :robot:

Follow-up to #3017 and #3019. On Android, iOS, and Pyodide, pip runs in a cross venv with a patched sys.platform. truststore chooses its backend from platform.system(), so it uses the OpenSSL backend instead of the macOS or Windows one. This backend reads OpenSSL's default CA file. On macOS hosts, that file is /etc/ssl/cert.pem (for python-build-standalone, and for a python.org framework build that has no cert.pem). That file still has the compromised eMudhra root (emSign ECC Root CA - G3). Apple blocks the bad intermediates through revocation in the Security framework, but this PEM file does not get those blocks.

This PR sets two variables to cibuildwheel's certifi bundle, only in the environments that have a patched sys.platform:

  • SSL_CERT_FILE: truststore then loads this file instead of the host's CA file. PIP_CERT alone is not sufficient here, because with truststore it only adds certs. With pip 26.2.2 and a PIP_CERT that has one unrelated CA, pip still connects to PyPI.

  • PIP_CERT: for pip without truststore (for example, pip < 24.2 pinned by the user). This path uses requests, which ignores SSL_CERT_FILE.
  • Scope per platform:

  • Android: only android_env (before-build, build, before-test, test install). build_env has the real sys.platform, so environment setup, repair, and the test runner do not get the variables.

  • iOS: the full cross venv environment (before-build, build, repair, and test). This venv patches the platform for every Python process, so the scope cannot be smaller without a separate host environment.

  • Pyodide: only the test venv (before-test, test install, test run). The patch is only in pyodide venv. The build environment is a normal host venv.
  • Values set by the user take priority.

    uv also reads SSL_CERT_FILE in its default mode, so this also covers the uv frontend on Android (uv < 0.13.4 has the bad root in its bundled webpki store).

    The Android and iOS test projects check in setup.py that both variables are set. The Pyodide test checks them in before-test. I ran the Pyodide tests locally: they fail without the fix and pass with it. Android and iOS were verified locally in the comments below.

    Diff: 278 lines (+208 / -70) across 3 files Reviewer: ryanking13 Review duration: 1289m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 278 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.337
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3020"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.6% (MEDIUM) · Higher = larger blast radius
    39.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.7% · Safe to merge
    15.7%