Skip to content

Custom cert bytes#30

Open
GauntletWizard wants to merge 1 commit intoauthzed:mainfrom
GauntletWizard:ted/cacert
Open

Custom cert bytes#30
GauntletWizard wants to merge 1 commit intoauthzed:mainfrom
GauntletWizard:ted/cacert

Conversation

@GauntletWizard
Copy link
Copy Markdown

In support of making authzed/zed#162 simpler.

certPool := x509.NewCertPool()
ok := certPool.AppendCertsFromPEM(cert)
if !ok {
panic("No x509 Certificates parsed")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this actually returns the same error as this:

return nil, errors.New("failed to append certs from CA PEM")

I think there are going to be too many scenarios where users might specify the wrong file and this function should actually fail rather than panic.

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