-
-
Notifications
You must be signed in to change notification settings - Fork 202
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
Option to disable certificate CA verification #277
Comments
If you don't validate that a certificate was issued by a trusted root, then other validity issues aren't really relevant - an attacker can trivially make a self signed cert that is otherwise valid. |
That is true, but I am much less concerned about attackers and much more concerned about enabling users to let server operators know when they have misconfigured their servers, such as by serving an expired certificate. Expiry dates have meaning to certificate creators, otherwise they wouldn't set them or they'd set them to year 9999 or something like that, and I'd like to preserve that as much as I can. |
If users care that much, why wouldn't they be able to have the appropriate root CAs loaded? |
Because, in this case, they're using a TLS-based protocol which explicitly recommends not using CA-signed certificates. |
I would be very surprised that a standard would specify the use of TLS without authenticity - almost all of TLS's security properties are lost in that case. I don't think I have ever seen a case where code wanted to validate certificates without checking CA trust, or if that is even possible to do in the TLS backends this crate wraps. |
https://gemini.circumlunar.space/docs/specification.gmi
And then goes on to explain that decision. There are a large number of client and server implementations of this which works fine. I'm in the process of building my own, hence my query. Just to be clear, if supporting use cases such as this one isn't something you envision for this library, that's fine! I found native_tls to have the nicest API of the various Rust TLS crates, but I can use a different one if native_tls isn't the right choice for the semantics of this application. |
That is explicitly recommending that you self-sign the servers and add their certs to the clients' CA root. That is what certificate pinning is. |
Right now it seems like the only way with native_tls to accept self-signed certificates is to disable all certificate validation with the
danger_accept_invalid_certs
function. This is way, way, way more permissive than I would like my application to be, but currently native_tls has no more granular options to permit self-signed certs but reject certs for any other validity issue.The text was updated successfully, but these errors were encountered: