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

switch :pem option to to OpenSSL::PKey.read to support other algorithms #720

Merged
merged 1 commit into from
Sep 29, 2021

Conversation

themgt
Copy link
Contributor

@themgt themgt commented Jan 29, 2021

I just threw this together but it seems to work, specs pass. Use case is connecting to Kubernetes 1.19 cluster which uses an EC key. Original code's call to OpenSSL::PKey::RSA.new on the key raises OpenSSL::PKey::RSAError: Neither PUB key nor PRIV key: nested asn1 error

OpenSSL::PKey::EC.new works for the EC key, but from the docs it appears OpenSSL::PKey.read is an agnostic solution that will auto-return the right PKey type so should work for RSA/DSA/EC?

@jnunemaker jnunemaker merged commit 1c09725 into jnunemaker:master Sep 29, 2021
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