Skip to content

Stdlib: openssl_x509_read() JIT/AOT happy-path leftover of #33497 — OpenSSLCertificate object AOT (ext/openssl/xp.c) #34048

Closed

Description

@PurHur

Category

stdlib · AOT happy-path leftover of #33497 / #7268

Problem

#33497 baked catchable argc/TypeError for openssl_x509_read(), but the string/OpenSSLCertificate happy path still throws:

openssl_x509_read() is not implemented for JIT in this compiler build (issue #7268)

Peer happy-path AOT bakes already landed for openssl_pkey_get_private (#34037) and openssl_pkey_get_public (#34038).

Repro Zend / VM AOT thin (master)
openssl_x509_read($pemLiteral) OpenSSLCertificate LogicException at compile
openssl_x509_read($cert) passthrough OpenSSLCertificate LogicException at compile
openssl_x509_read(null) TypeError TypeError (already #33497)

php-src reference

PHP implementation target

  • ext/openssl/openssl_x509_read.php — call into new JitOpensslX509Read bake (peer JitOpensslPkeyGetPrivate)
  • Compile-time PEM literal → VmOpensslX509Native::normalizeCertificatePem → allocate OpenSSLCertificate with __osslPem
  • Known OpenSSLCertificate object → passthrough
  • lib/JIT/Builtin/Type/Object_.php — declare __osslPem on opensslcertificate (peer asymmetric key)
  • No new runtime/*.c

Repro

./script/aot-smoke.sh   # must stay 8/8
./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_HELPER_RUNTIME_O=0 php bin/compile.php -o /tmp/x test/repro/issue_NNNN_openssl_x509_read_happy_aot.php && /tmp/x'

Done when

  • AOT matches VM/Zend on PEM literal → OpenSSLCertificate and object passthrough
  • ./script/aot-smoke.sh still 8/8
  • Targeted ./script/phpunit.sh --filter IssueNNNN…
  • No new runtime/*.c

Activity

  1. added
    bugSomething isn't working
    phase-4:stdlibPhase 4 – stdlib for web apps
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Aug 23, 2026
  2. PurHur commented on Aug 23, 2026

    @PurHur
    OwnerAuthor

    claim: implementing openssl_x509_read thin AOT happy-path bake (peer #34037 pkey_get_private) — PEM literal → OpenSSLCertificate + __osslPem.

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

    area:vmVirtual machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions