-
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
chore(tls): Refactor parsing certificate and identity #1763
chore(tls): Refactor parsing certificate and identity #1763
Conversation
1b5d429
to
e0a63b4
Compare
I think this and #1748 need a more holistic design discussion of what we're trying to achieve here and how to balance the trade-offs. As is, I don't think the changes here are a clear improvement. I think the goals are:
Given the developments in upstream rustls with the migration to rustls-pki-types, personally I think it could be worth simplifying so that our public API fully relies on rustls-pki-types directly (which was not the case before rustls adopted rustls-pki-types). We could still provide wrapper around the use of rustls-pemfile but I'm personally not convinced the benefit on (2) is worth the costs on (3), and some of the ways in which it might make the API worse. |
Can you elaborate what points in the existing implementations are clear than this changes? Regarding to #1748, this pull request is not related to it. Since it contains difficult problem, this is completely separated patch to make easier implementation at the moment. This change reduces the duplicate logic implementation and reimplementing of rustls providing. |
The previous implementation had a higher-level interface (adding certificates to the root store). This implementation ends up deduplicating the certificate parsing (good) but actually duplicates how certificates get added to the root store (even though this doesn't result in much extra code). I'm also not a fan of the impl blocks living in a separate file from the struct definition they're linked to, and I don't think |
Thanks for the explanation.
Given this opinion, I feel it sounds this implementation is better than the previous one regarding this point. What I aimed to do are removing the higher level interface, and resolves the asymmetry between what
I understand what you concern. I think it is an acceptable drawback thinking of reducing importing the previous functions and expressing that they are related to certificate or identity type, but I also understand the cost of not being located at one place. I will change them to independent functions.
In this case, I would think this can be thought as one set of certificates, so it can be regarded as 1:1 conversion. But I think we can name more descriptively as well. |
1cd611a
to
1a5de9d
Compare
1a5de9d
to
db60247
Compare
db60247
to
6dca94e
Compare
6dca94e
to
357845d
Compare
8a8e8e2
to
2f41f4a
Compare
2f41f4a
to
52b4d50
Compare
52b4d50
to
045008c
Compare
b223884
to
e11bab6
Compare
e11bab6
to
b756b0b
Compare
…ls-pki-types type to independent function
b756b0b
to
335e1a9
Compare
Refactors parsing certificate and identity.