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

Make raw PEM cert bundle string public #22

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

yosh
Copy link

@yosh yosh commented May 1, 2020

This just makes the PEM cert bundle accessible to users of this library. I found this useful in conjunction with private CAs generated out of Go programs. The other languages supported in the project already support this, since a .crt file is simply shipped with them.

@mattrobenolt
Copy link
Member

mattrobenolt commented Sep 22, 2020

Maybe this would be better as a function call instead that returned the private variable. Just in case.

func RawCertificates() string {
  return pemcerts
}

Or similar. I'm not crazy about the name.

@yosh
Copy link
Author

yosh commented Sep 26, 2020

I went with CACertsAsPEM to be more explicit, but I'm not too crazy about any of these names either.

@mattrobenolt mattrobenolt force-pushed the master branch 5 times, most recently from 2817166 to 5031444 Compare May 6, 2021 21:42
@mattrobenolt
Copy link
Member

@yosh I plan on bringing this in soon. I added some work to maintain a v1 tag and have the certs autoupdate. I'll bring this in with that.

@yosh
Copy link
Author

yosh commented May 13, 2021

Cool, sounds good.

@dolmen
Copy link
Contributor

dolmen commented Sep 20, 2021

Maybe this would be better as a function call instead that returned the private variable.

This isn't a variable but a constant. So there is no risk of corruption.

@dolmen
Copy link
Contributor

dolmen commented Sep 20, 2021

@yosh If you only need the certificate string I recommend instead to just take gen.go into your project and adapt it to your need.

@dolmen
Copy link
Contributor

dolmen commented Nov 8, 2021

I'm against this change because that would expose the format of the list of root certificates which is currently a string but could another format (pre-parsed) in the future.

As I wrote above, users who need the certificate string could as well just take gen.go into their project and adapt it to their need.

Also I don't think there is many users who need both the CACerts() API and a string API in the same program.

@yosh
Copy link
Author

yosh commented Nov 9, 2021

I no longer actively develop the project that necessitated this, so I don't really have a strong opinion here. Happy to just close out this PR unmerged if that's consensus.

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.

3 participants