-
-
Notifications
You must be signed in to change notification settings - Fork 16.1k
OpenSslSession: Add support to defensively check for peer certs #14641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Motivation ---------- In a use-case where an application wants to check if a peer certificate has been provided without throwing an exception if none are found (as is currently the behavior when calling SSLSession#getPeerCertificates) there is currently no API available to do that. The use-case which prompted this addition is to defensively check if a mTLS connection has been established with access to the SSLSession. Modifications ------------- This changeset introduces a new API to the OpenSslSession which allows to check if peer certs are available (hasPeerCertificates) and returns true if this is the case. Result ------ It is now possible to check if mTLS is enabled (through checking if peer certs are presented) without throwing an exception if not.
handler/src/test/java/io/netty/handler/ssl/OpenSslEngineTest.java
Outdated
Show resolved
Hide resolved
@daschl I am not against this change but I wonder how this will be useful for anyone except for netty itself ? The |
@daschl @chrisvest @idelpivnitskiy PTAL again... |
handler/src/test/java/io/netty/handler/ssl/OpenSslEngineTest.java
Outdated
Show resolved
Hide resolved
handler/src/test/java/io/netty/handler/ssl/OpenSslEngineTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one minor comment, otherwise LGTM
handler/src/test/java/io/netty/handler/ssl/OpenSslEngineTest.java
Outdated
Show resolved
Hide resolved
handler/src/test/java/io/netty/handler/ssl/OpenSslEngineTest.java
Outdated
Show resolved
Hide resolved
Motivation ---------- In a use-case where an application wants to check if a peer certificate has been provided without throwing an exception if none are found (as is currently the behavior when calling SSLSession#getPeerCertificates) there is currently no API available to do that. The use-case which prompted this addition is to defensively check if a mTLS connection has been established with access to the SSLSession. Modifications ------------- This changeset introduces a new API to the OpenSslSession which allows to check if peer certs are available (hasPeerCertificates) and returns true if this is the case. Result ------ It is now possible to check if mTLS is enabled (through checking if peer certs are presented) without throwing an exception if not. --------- Co-authored-by: Norman Maurer <[email protected]>
…) (#14653) Motivation ---------- In a use-case where an application wants to check if a peer certificate has been provided without throwing an exception if none are found (as is currently the behavior when calling SSLSession#getPeerCertificates) there is currently no API available to do that. The use-case which prompted this addition is to defensively check if a mTLS connection has been established with access to the SSLSession. Modifications ------------- This changeset introduces a new API to the OpenSslSession which allows to check if peer certs are available (hasPeerCertificates) and returns true if this is the case. Result ------ It is now possible to check if mTLS is enabled (through checking if peer certs are presented) without throwing an exception if not. Co-authored-by: Michael Nitschinger <[email protected]>
…) (#14653) Motivation ---------- In a use-case where an application wants to check if a peer certificate has been provided without throwing an exception if none are found (as is currently the behavior when calling SSLSession#getPeerCertificates) there is currently no API available to do that. The use-case which prompted this addition is to defensively check if a mTLS connection has been established with access to the SSLSession. Modifications ------------- This changeset introduces a new API to the OpenSslSession which allows to check if peer certs are available (hasPeerCertificates) and returns true if this is the case. Result ------ It is now possible to check if mTLS is enabled (through checking if peer certs are presented) without throwing an exception if not. Co-authored-by: Michael Nitschinger <[email protected]>
Motivation
In a use-case where an application wants to check if a peer certificate has been provided without throwing an exception if none are found (as is currently the behavior when calling SSLSession#getPeerCertificates) there is currently no API available to do that.
The use-case which prompted this addition is to defensively check if a mTLS connection has been established with access to the SSLSession.
Modifications
This changeset introduces a new API to the OpenSslSession which allows to check if peer certs are available (hasPeerCertificates) and returns true if this is the case.
Result
It is now possible to check if mTLS is enabled (through checking if peer certs are presented) without throwing an exception if not.