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

FIXIT: Generate a better error for incorrectly generated private key #438

Merged
merged 1 commit into from
Jun 8, 2020

Conversation

banaag
Copy link
Collaborator

@banaag banaag commented Jun 8, 2020

Fixes #354

@banaag banaag requested a review from twifkak June 8, 2020 21:37
@@ -52,7 +52,7 @@ func ParsePrivateKey(keyPem []byte) (crypto.PrivateKey, error) {
var pemBlock *pem.Block
pemBlock, keyPem = pem.Decode(keyPem)
if pemBlock == nil {
return nil, errors.New("invalid PEM block in private key file")
return nil, errors.New("invalid PEM block in private key file, make sure to use the right key type. Generate the key using: openssl ecparam -out priv.key -name prime256v1 -genkey")
Copy link
Member

Choose a reason for hiding this comment

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

Maybe instead of inlining the openssl command, link to "step 2 of https://github.com/WICG/webpackage/tree/master/go/signedexchange#creating-our-first-signed-exchange", which includes the necessary command to regenerate the cert, too.

Alternatively, we could update our README or our wiki to include this information, and link to that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@banaag banaag merged commit ce10ebb into master Jun 8, 2020
@banaag banaag deleted the fixit-errmsg branch June 8, 2020 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants