Skip to content
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

allow parsing several certificates from a single pem #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Keruspe
Copy link

@Keruspe Keruspe commented May 12, 2020

Is this something we might want to do? it would facilitate importing certificate chains.

Not sure about the security-framework impl which I haven't tested

Not sure how to do that with schannel, suggestions welcome

@Keruspe
Copy link
Author

Keruspe commented May 12, 2020

The macos failure is unrelated to this issue.
The schannel part could be done by adding a dep on the pem crate which can transform a collection of PEMs in a String into some Vec, each element of this vec carrying the corresponding DER. (This could also be used for implement Certificate::from_pem for ios btw)

@sfackler
Copy link
Owner

The functionality seems reasonable to me. Full PEM parsing isn't necessary for schannel, just the ability to identify the individual entries. You can probably pull the logic from another PR: https://github.com/sfackler/rust-native-tls/pull/147/files#diff-f3a4e813fbd2200f75435edfe7dcba3d

@Keruspe
Copy link
Author

Keruspe commented May 14, 2020

@sfackler Will give this a look, thanks for the pointer!

wrt naming, I didn't try and find some fancy naming and just borrowed the name from openssl. Not sure if we want a better name or if that's well enough

@sfackler
Copy link
Owner

stack_from_pem seems fine for now. I think we'd probably just make this the only interface in the next breaking release and rename to from_pem.

@Keruspe
Copy link
Author

Keruspe commented Mar 28, 2022

@sfackler rebased on top on 0.2.9 and added impl for schannel based on PemBlock

@sfackler
Copy link
Owner

It looks like the windows build is red.

@Keruspe
Copy link
Author

Keruspe commented Mar 31, 2022

Heh, my bad sorry. Fixed the PemBlock namespacing.

(I do not have access to a windows system though...)

@Keruspe
Copy link
Author

Keruspe commented Jul 11, 2024

@sfackler any news on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants