-
Notifications
You must be signed in to change notification settings - Fork 7.4k
net: sockets: tls: Add new options for certificate verification #90068
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
base: main
Are you sure you want to change the base?
Conversation
Add new TLS socket option, TLS_CERT_VERIFY_RESULT, to obtain the certificate verification result from the most recent handshake on the socket. The option works if TLS_PEER_VERIFY_OPTIONAL was set on the socket, in which case the handshake may succeed even if certificate verification fails. Signed-off-by: Robert Lubos <[email protected]>
Extract server configuration, client configuration and test shutdown into separate functions so that they're reusable in other tests. Signed-off-by: Robert Lubos <[email protected]>
Add test case to verify if TLS_CERT_VERIFY_RESULT socket option works as expected. Signed-off-by: Robert Lubos <[email protected]>
Add new TLS socket option, TLS_CERT_VERIFY_CALLBACK, which allows to register an application callback to verify certificates obtained during the TLS handshake. Signed-off-by: Robert Lubos <[email protected]>
Add test case to verify if TLS_CERT_VERIFY_CALLBACK socket option works as expected. Signed-off-by: Robert Lubos <[email protected]>
fa5c83c
to
fc6641d
Compare
|
} | ||
|
||
cert_verify = (struct tls_cert_verify_cb *)optval; | ||
if (cert_verify->cb == NULL && cert_verify->ctx != NULL) { |
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.
Why do we care what the ctx is here, or was the idea that user can unset the callback by setting both values null (this is not documented if that is the idea)?
Add new TLS socket options:
TLS_CERT_VERIFY_RESULT
to retrieve certificate verification result,TLS_CERT_VERIFY_CALLBACK
to regsiter ceritificate verification callback.Plus associated tests.
Resolves #52541