-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(transport): Add support client mTLS #77
feat(transport): Add support client mTLS #77
Conversation
45e9c70
to
9650642
Compare
4d794e8
to
a9e10e4
Compare
a9e10e4
to
1d9f746
Compare
}; | ||
let mut client_root_cert_store = tokio_rustls::rustls::RootCertStore::empty(); | ||
match client_root_cert_store.add_pem_file(&mut cert) { | ||
Err(_) => return Err(Box::new(TlsError::CertificateParseError)), |
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.
do we want to attach the error message here?
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.
I'll update this - we likely do want the error message.
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.
Only kidding... the error type is ()
.
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.
LGTM just left a few questions inline.
This commit adds a simple API for specifying the TLS certificate a GRPC client will present (via the same `Identity` wrapper as a server cert is configured). It also adds an API to specify which CA certificate client TLS certificates will be validated against for servers. To demonstrate usage, a new example `tls_client_auth` is added, using OpenSSL for the client and Rustls for the server.
1d9f746
to
5e9a073
Compare
OK, I think these are all 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.
Fantastic! Thank you! We will def showcase this with the next release 😄
This commit adds a simple API for specifying the TLS certificate a GRPC client will present (via the same `Identity` wrapper as a server cert is configured). It also adds an API to specify which CA certificate client TLS certificates will be validated against for servers.
* Add regression test for hyperium#77 * Fix handshake alert * Fix style
This commit adds a simple API for specifying the TLS certificate a gRPC client will present (via the same
Identity
wrapper as a server cert is configured). It also adds an API to specify which CA certificate client TLS certificates will be validated against for servers.To demonstrate usage, a new example
tls_client_auth
is added. In order to implement this, new test certificates are added to thedata
directory oftonic-examples
. Currently only one of the two added client certificates is used, the other is intended for future work but since it was issued by the same CA, it's helpful to add it now.Some of the code for loading certificates and private keys previously existed in the
TlsAcceptor
class - this has been factored out to a new module so it can be reused byTlsConnector
also.Currently this is only implemented for
rustls
- an OpenSSL implementation will follow on this PR shortly.