You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The OpenSSL::PKey::RSA.new function fails to load encrypted RSA keys when not created with the -traditional option.
I have tested with jruby 9.4.12.0 and jopenssl: 0.15.3
Steps to reproduce:
$ openssl genrsa -aes256 -passout pass:password -out test.key 4096
$ jruby check.rb
ruby: jruby 9.4.12.0 (3.1.4) 2025-02-11 f4ab75096a OpenJDK 64-Bit Server VM 11.0.25+9-post-Ubuntu-1ubuntu122.04 on 11.0.25+9-post-Ubuntu-1ubuntu122.04 +jit [x86_64-linux]
openssl: 2.2.3
jopenssl: 0.15.3
OpenSSL::PKey::RSAError: Neither PUB key nor PRIV key:
initialize at org/jruby/ext/openssl/PKeyRSA.java:310
new at org/jruby/RubyClass.java:936
<main> at check.rb:6
$ # with "normal" ruby:
$ ruby check.rb
ruby: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
openssl: 3.0.0
true
When creating the key with -traditional option it does work:
The
OpenSSL::PKey::RSA.new
function fails to load encrypted RSA keys when not created with the-traditional
option.I have tested with jruby 9.4.12.0 and jopenssl: 0.15.3
Steps to reproduce:
When creating the key with
-traditional
option it does work:check.rb script used:
The text was updated successfully, but these errors were encountered: