Skip to content

Network proxy certificates fail Python 3.13+ strict TLS verification: missing Authority Key Identifier #45202

Open

Description

@ediril

What version of Codex CLI is running?

codex-cli 0.154.0

What subscription do you have?

Pro

Which model were you using?

gpt-6-astra

What platform is your computer?

Darwin 25.5.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

No response

Codex doctor report

What issue are you seeing?

Codex 0.154.0’s network proxy generates host certificates without an Authority Key
Identifier (AKI). Python 3.14 rejects them under its default TLS verification settings:

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed:
Missing Authority Key Identifier (_ssl.c:1077)

This causes otherwise-allowed HTTPS reads to fail inside the sandbox. The agent then
requests approval to retry outside it.

Environment

  • macOS ARM64
  • Official Codex 0.154.0, using app-server
  • Network proxy enabled, limited mode
  • api.fivetran.com explicitly allowed
  • Python 3.14, using urllib.request.urlopen() with default certificate verification

Suggested fix

In codex-rs/network-proxy/src/certs.rs, within issue_host_certificate_pem(), enable AKI
before signing:

  params.use_authority_key_identifier_extension = true;

Validation

Using the original and corrected certificate-generation functions with the pinned rcgen
0.14.9:

Verification Original certificate With AKI enabled
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
OpenSSL verify -x509_strict Error 85: Missing Authority Key Pass
Identifier
─────────────────────────────────
Python 3.14 default TLS context Same verification failure Pass

The corrected certificate passes without disabling verification or changing trust policy.
Validation covered certificate generation and TLS handshakes; we have not rebuilt the full
Codex binary.

An HTTPS proxy regression test using Python’s default TLS context would help catch this;
HTTP-only proxy tests do not exercise certificate validation.

What steps can reproduce the bug?

Reproduction

  1. Enable the network proxy and allow an HTTPS destination.
  2. Execute a Python HTTPS GET inside the sandbox using urllib.request.urlopen().
  3. Observe the certificate verification failure.

A certificate-only probe through the proxy confirmed:

Subject: CN=rcgen self signed cert
Issuer: CN=network_proxy MITM CA
Extensions:
2.5.29.17 Subject Alternative Name
2.5.29.15 Key Usage
2.5.29.37 Extended Key Usage

Authority Key Identifier: absent

What is the expected behavior?

The corrected certificate passes without disabling verification or changing trust policy.
Validation covered certificate generation and TLS handshakes; we have not rebuilt the full
Codex binary.

Additional information

No response

Activity

  1. added
    bug
    on Sep 13, 2026
  2. added
    CLI
    connectivity
    sandbox
    on Sep 13, 2026
  3. dcrakesh commented on Oct 8, 2026

    @dcrakesh

    Additional Linux Codex 0.161.0 reproduction: native verification code 85

    Adding a sanitized follow-up from a separate installation. This is a certificate-compatibility report, not a request to disable certificate verification or bypass the managed proxy.

    Environment

    • Official Linux x86_64 Codex CLI 0.161.0, running as an ordinary user under WSL2 / Ubuntu 26.04.1.
    • Python 3.14.4, Requests 2.32.5, urllib3 2.6.3, cryptography 46.0.5, OpenSSL 3.5.5.
    • Task-scoped managed proxy and restricted sandbox; certificate-required mode, hostname checks and strict verification remain enabled.

    Observed failure

    An allowed HTTPS fetch for a public dependency failed with a native SSLCertVerificationError code 85, which the installed OpenSSL identifies as Missing Authority Key Identifier. A bounded exception inspector recovered a single code from the Requests/urllib3 exception chain, with complete traversal and no conflicting code.

    The actual child process passed its managed-CA preflight. The helper supplied the validated managed CA bundle explicitly as per-request verify=CA_PATH, retained trust_env=False, and used only the configured explicit proxy. This ruled out the previously suspected omission of the managed bundle for that attempt; it did not produce a successful TLS connection.

    The failed peer certificate/chain was not captured. Attribution to the certificate generator below is supported by retained invocation/configuration and version-pinned source analysis, not direct inspection of the failed peer chain or binary disassembly. No repaired runtime or successful package download is claimed.

    Pinned source evidence

    Codex release source at commit 979011409de0a60b52f179721948e65531d26144 starts the managed proxy in the task's Linux CLI process. Relevant public sources:

    The release lockfile resolves rcgen 0.14.9. Inspection of its certificate parameters/serialization and issuer/extension code shows that the host parameters default AKI to disabled. Enabling the following before signing emits a noncritical AKI derived from the issuer's Subject Key Identifier:

    params.use_authority_key_identifier_extension = true;

    Applicability and reversal of this one-line change were checked against isolated source fixtures. No Rust certificate generator or complete patched Codex binary was built or executed.

    Offline reproduction on the installed client software

    Five guarded, entirely in-memory synthetic TLS cases produced:

    Synthetic case Result
    CA-issued server certificate missing AKI Verification code 85
    Otherwise equivalent certificate with noncritical AKI matching issuer SKI Handshake passes
    Corrected certificate, wrong hostname Rejected, code 62
    Corrected certificate, expired Rejected, code 10
    Corrected certificate, untrusted issuer Rejected, code 20

    All cases retained identical strict verification flags, certificate-required mode and hostname checking. They used MemoryBIO pairs without sockets, DNS, external requests or system trust changes. These tests demonstrate the proposed mechanism with synthetic certificates; they are not validation of the actual Rust generator or a repaired executable. Additional offline helper/policy tests are likewise not substitutes for artifact-level testing.

    Requested maintainer guidance

    Please confirm whether this issuer behavior is recognized and whether an official fixed Linux x86_64 release or supported backport is available or planned. For a candidate, please identify the exact version/source commit and verifiable artifact checksum or build provenance.

    A regression covering the actual generator's DNS/IP host certificates, AKI-to-issuer-SKI matching and noncriticality, plus strict TLS positive and hostname/expiry/untrusted-issuer negative cases would allow validation without weakening the client. Existing SANs, signatures, key usages, CA constraints and sandbox/proxy enforcement should remain unchanged.

    No fixed vendor artifact, vendor commitment or recovery date has been established on this installation. We have not disabled strict verification, added unrelated trust roots, bypassed the proxy, downgraded the client, or replaced the installed executable.

    This follow-up intentionally omits private project references, account and infrastructure identifiers, local user paths, credentials, raw logs, certificate contents and business data.

  4. ediril commented on Oct 21, 2026

    @ediril
    Author

    Could someone please look into this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIbugconnectivitysandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions