Skip to content

ext/openssl: openssl.cnf-driven options (config, req_extensions, x509_extensions, CSR attributes) #238

Open

Description

@blacktrs

Priority P1. Follow-up to #211 / PR #236.

openssl_csr_new, openssl_csr_sign, openssl_pkey_new, openssl_pkey_export, openssl_pkcs7_* and openssl_cms_* accept config, req_extensions, x509_extensions in $options and extra CSR attributes. Today these throw ValueError because there is no openssl.cnf support.

Why it matters: self-signed certificates with subjectAltName (dev servers, ACME clients, test PKIs) and CA certificates (basicConstraints=CA:TRUE) can only be requested through extension sections.

Scope

  • Load a config file (NCONF_load / X509V3_EXT_add_nconf, or X509V3_set_nconf); default to the system openssl.cnf like php.
  • req_extensions / x509_extensions section names, [ req ] defaults (default_bits, default_md, distinguished_name, prompt), string_mask.
  • Extra CSR attributes (challengePassword, etc.).
  • DH openssl_pkey_new without p/g should generate default parameters like php (currently returns false).

Linux note: the default openssl.cnf location differs between Debian and Alpine.

Done when: a CSR / self-signed cert with SAN built from a config section matches php's openssl_x509_parse output; tests use committed .cnf fixtures.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions