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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client authentication #3
Comments
At the minute client auth isn't supported. Can I ask what API you're using that requires it? |
I'm writing a mqtt client library where client authentication is pretty common |
things (in the docs?); while it is true that client certs are uncommon, they don't seem any of the above things to me. There are indeed real-world applications that make use of this.
|
(copying and pasting my explanation from elsewhere)
There's a few problems with it.
All of these are fixed in TLS1.3: client identities are encrypted and renegotiation is dropped. Actually implementing client auth is quite a minor amount of work. It's probably best to do as a opt-in feature. |
Even as an opt in is awesome. Will wait for this feature :) |
@ctz I've started taking a look at how you would implement TLS 1.2 client authentication. You can see the initial changes are here. The main issue I've run into now is that the Any thoughts on how you would approach that? |
I would be happy for somebody to add this functionality to ring. It is needed for many reasons and it would be easy to do. |
I've also been working on-and-off on client auth. I ought to push my in-progress branch. But I could use a lot of your progress so far, so thanks!
At the minute I've made The ideal solution is to have |
@ctz if you push up your branch I can compare our approaches and see what still needs work. I've opened an issue in ring here: briansmith/ring#253. |
@ctz got client auth working from your branch! Thanks for the work in implementing this. Are you also planning on adding client auth support from the server end? There's also a small issue where the signature/hash algorithm for the CertificateVerify message is calculated based on the selected ciphersuite, and not based on the capabilities of the selected certificate. |
Yes that should be easier.
Yes, that issue is also present in the normal server authentication. There and here rustls treats certificates as opaque, so will happily use a key with a cert not containing appropriate key usages, expired certs, etc. That kind of misconfiguration is hopefully rare, but I agree it's not ideal for rustls to plough on regardless. In any case, that information is mostly for the relyer. |
Since supporting EdDSA signatures would require maintaining the full message transcript anyway, is the idea that certain configs could disable EdDSA and hence only need to store one (or several) rolling hashes? |
Hi. I see a client auth branch 馃槃 Thanks a lot. Is this ready to be merged to master? (Also any plans for adding rustls to crates.io?) |
It's close to done for client auth by clients, but not for servers yet. It's still in progress, but it'll be a week or so before there's more progress due to travel and stuff :) |
Now pushed. |
Thanks :) |
I know this has been closed by any chance to having Server side client authentication as well ? |
@salmankhalid-plt what do you mean? As I understand it, only servers can authenticate clients, so that's naturally what we already support. What use case do you have in mind that you think rustls doesn't yet support? |
I've no idea what the OP meant. However:
This does not come even close to the specification of TLS. Of course, both ends can authenticate each other - search for "mutual TLS" (which will also explain why there is no separate spec for mTLS). |
I think that matches what I said? Servers can authenticate clients, and clients authenticate servers. |
The current state is client auth is supported on both the client- and server-side. |
The way I understood your reply was that only server authenticates client, while the OP asked for the client to authenticate server:
Otherwise, we seem to be on the same page. |
There were two bugs. webpki didn't: 1. read the X.509 Name Constraints field in its entirety, nor 2. check the certificate subject against the constraints correctly (1) is a simple fix, (2) requires reading the Common Name from the certificate. Requires lifting some DER parsing logic from ring to parse UTF8String and Set fields. Ring doesn't support those and isn't likely to in the near future, see briansmith/ring#1265. Closes #3.
Hi. If I use this library for writing a client. Can I set client certificate in the API for third party servers to do client authentication ?
To be more specific, I'm trying to write client code using your library (Thanks 馃槃 ) . I'm able to authenticate server by providing the CA (
root_store .add_pem_file(ca.crt)
). Can I also simultaneously add client certificate for 3rd party servers to authenticate this client?(Didn't use tls much before. Plz let me know if my question itself doesn't make sense)
The text was updated successfully, but these errors were encountered: