Deprecate HttpServerRequest.peerCertificateChain() and add peerCertificates() (4.x) - #6323
Open
jnbdz wants to merge 1 commit into
Open
Deprecate HttpServerRequest.peerCertificateChain() and add peerCertificates() (4.x)#6323jnbdz wants to merge 1 commit into
jnbdz wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #5389
Motivation
On 5.x this is already solved (7a75c82 removed every
javax.security.certusage), but on 4.xHttpServerRequest.peerCertificateChain()still returnsjavax.security.cert.X509Certificate[], a JDK API deprecated for removal, and — unlikeHttpConnection,NetSocketandWebSocketBase, which were deprecated and given apeerCertificates()replacement in 4.x — the request has nojava.security.certcounterpart. Users get the "deprecated and marked for removal" warning with no way around it short ofreq.connection().peerCertificates().Changes
HttpServerRequest.peerCertificateChain()is@Deprecated, pointing topeerCertificates()/sslSession().default List<Certificate> peerCertificates()delegating toconnection().peerCertificates()— a default method like the existingisSSL()/sslSession(), so it is source and binary compatible with external implementations of the interface.HttpServerRequestWrapperdelegates explicitly.HttpTLSTestcapturesreq.peerCertificates()on the server side andtestTLSClientCertRequiredasserts 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).