-
Notifications
You must be signed in to change notification settings - Fork 82
Could not parse valid public key #176
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
Comments
I should note that this exact same code works fine in the regular ruby implementation. |
I have replicated the issue in
|
In regular ruby using
|
I have found a workaround by following the instructions for loading public keys here. Essentially, I have specified that the key is an RSA key using the below line:
|
This issue affects public key and certificate bundles also. I created a reproduce case here: https://github.com/p-mongo/tests/tree/master/tls-load-bundle Given the following files:
Using jruby: # OK pk = OpenSSL::PKey.read(File.read('client.key')) # OK pk = OpenSSL::PKey::RSA.new(File.read('client.pem')) # Fails pk = OpenSSL::PKey.read(File.read('client.pem')) MRI is able to read the certificate out of the bundle via Checked using: jruby 9.2.5.0 (2.5.0) 2018-12-06 6d5a228 OpenJDK 64-Bit Server VM 25.171-b11 on 1.8.0_171-8u171-b11-2-b11 +jit [linux-x86_64] jruby 9.2.7.0 (2.5.3) 2019-04-09 8a269e3 OpenJDK 64-Bit Server VM 25.171-b11 on 1.8.0_171-8u171-b11-2-b11 +jit [linux-x86_64] |
Our current workaround for certificate+private key bundles: mongodb/mongo-ruby-driver@e74ce7a#diff-ed625ecdabf4aeff5d1a5fc04b958a3a |
Hello, im having issues with parsing public keys that I know are valid. The only error message i get says
ArgumentError: Could not parse PKey
.Im using the
jruby:9.2.0-jdk-alpine
docker image to run my application.Below is the output from
pry
that contains both the valid key, and the error message when I try to parse the key:The text was updated successfully, but these errors were encountered: