-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
Provide an iterator for CertificateChain #672
Conversation
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.
Seems fine to me.
Maybe we should also try to upstream some of the more friendly interfaces from our wrappers into rustls? The current solution feels a bit kludgey. |
AFAIK the main benefit of these interfaces as they stand is allowing people to avoid exposure to rustls's unstable API, so I'm not sure that would be a win. |
Well, my point is whether we can make a similar API stable in rustls. I filed rustls/rustls#348, feel free to comment there if you have any ideas around this. |
@kim, both of your versions implemented iterators that yield owned |
@djc Because It turns out that only one callsite is affected (or even exists?), so it's not too bad. I'm not really familiar with the |
I'm sorry, I meant to distinguish between iterating over references vs iterating over owned types. I think the current changes probably contain too much stuff. Can we just have an |
Sure. You prefer |
That would still lead to confusing breakage on each rustls update due to crate version mismatches, unless we reexport rustls per #300 and encourage people to use it that way.
Idiomatically you'd have both. |
I feel like we're talking past each other. To summarise:
Alright. So if I provide a |
Sorry, to clarify: |
I think me and @djc have somewhat different perspectives here, and that's produced some confusion. I apologize for that.
This was my intention in adding those newtypes to begin with, though the specific goal was to allow callers to be ignorant of rustls, not necessarily to force them to--so exposing the details is acceptable so long as it's not required for simple cases.
I'd be happy to merge either/both of those, though I'd consider an approach which doesn't expose rustls to be better still. An easier solution than wrapping/unwrapping the newtypes might be to fall back on |
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.
The current state looks good to me.
Ok, thanks. Please forgive my ignorance, I'm coming from a programming language whose main compiler can auto-derive every typeclass through a newtype 🤷♂ |
No worries, always happy to help someone get up to speed! |
Yeah, sorry for the confusion and mixed messages here, and thanks for sticking with it! |
Trying to integrate #644 I realise I'm kind of back to square one, because I can't get at the actual certificate :)