Skip to content

Deprecate HttpServerRequest.peerCertificateChain() and add peerCertificates() (4.x) - #6323

Open
jnbdz wants to merge 1 commit into
eclipse-vertx:4.xfrom
SiteNetSoft:issue-5389-request-peer-certificates-4x
Open

Deprecate HttpServerRequest.peerCertificateChain() and add peerCertificates() (4.x)#6323
jnbdz wants to merge 1 commit into
eclipse-vertx:4.xfrom
SiteNetSoft:issue-5389-request-peer-certificates-4x

Conversation

@jnbdz

@jnbdz jnbdz commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Related to #5389

Motivation

On 5.x this is already solved (7a75c82 removed every javax.security.cert usage), but on 4.x HttpServerRequest.peerCertificateChain() still returns javax.security.cert.X509Certificate[], a JDK API deprecated for removal, and — unlike HttpConnection, NetSocket and WebSocketBase, which were deprecated and given a peerCertificates() replacement in 4.x — the request has no java.security.cert counterpart. Users get the "deprecated and marked for removal" warning with no way around it short of req.connection().peerCertificates().

Changes

  • HttpServerRequest.peerCertificateChain() is @Deprecated, pointing to peerCertificates() / sslSession().
  • New default List<Certificate> peerCertificates() delegating to connection().peerCertificates() — a default method like the existing isSSL() / sslSession(), so it is source and binary compatible with external implementations of the interface.
  • HttpServerRequestWrapper delegates explicitly.
  • Test: HttpTLSTest captures req.peerCertificates() on the server side and testTLSClientCertRequired asserts the client chain is exposed (HTTP/1.x and HTTP/2).

Since master is already clean, #5389 itself could probably be closed once this lands (or independently).

…icates()

HttpServerRequest still exposes the peer certificate chain through
javax.security.cert.X509Certificate, deprecated for removal by the JDK,
and unlike HttpConnection, NetSocket and WebSocketBase it does not offer
the java.security.cert replacement.

Deprecate peerCertificateChain() and add a default peerCertificates()
delegating to the connection, so that HTTP server requests can be handled
without touching the javax.security.cert API.

Related to eclipse-vertx#5389
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