Skip to content

feat(admin): expose SSL validity and validate certificate key pairs - #14243

Open
qingtianbuyu wants to merge 4 commits into
apache:masterfrom
qingtianbuyu:codex/ssl-admin-certificate-metadata
Open

qingtianbuyu wants to merge 4 commits into
apache:masterfrom
qingtianbuyu:codex/ssl-admin-certificate-metadata

Conversation

@qingtianbuyu

Copy link
Copy Markdown

Description

Clients that manage certificates through the Admin API need the validity window to plan renewal. The API also needs to catch a mismatched certificate and private key when the configuration is submitted, before it reaches the data plane.

  • Return validity_start and validity_end as Unix seconds on SSL list and detail responses. Derive the dates from the first certificate in each PEM chain at read time.
  • Return certs_validity in the same order as certs, with null entries for references or certificates whose dates cannot be parsed. Continue omitting key and keys from SSL GET responses.
  • Validate inline certificate and private-key pairs in SSL Admin API writes. A mismatch returns HTTP 400. A PATCH validates the merged resource, so an existing mismatch must be corrected when that resource is updated. Expired certificates with matching keys can still be updated or disabled.
  • Update the English and Chinese Admin API docs, the OpenAPI schema and bundle, and the Admin API regression tests.

Which issue(s) this PR fixes

Related to #1571, which requested SSL expiration metadata.

Validation

  • Exercised the SSL Admin API against an isolated APISIX and etcd instance. Checked RSA and ECDSA pairs, PEM chains, mismatched writes, expired certificate updates, validity fields, and references.
  • Ran Lua syntax checks on the changed source files and all 28 Lua test blocks in t/admin/ssl.t.
  • Ran make bundle-admin-api-spec and verified that the generated bundle matches the committed file. git diff --check passed.
  • The full Test::Nginx run and upstream CI checks are pending.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible

@qingtianbuyu
qingtianbuyu marked this pull request as ready for review November 22, 2026 07:14
yangqing added 3 commits November 27, 2026 13:43
Manage plugin drafts and releases through the Admin API. Load active versions from etcd and support rolling back to bundled plugins.
Load active etcd plugin releases before considering configured Lua files. Default file loading to off and preserve active registry plugins during reloads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant