However, We no longer use this code in Terminii that will be loaded in JRuby (and so don't use this code at all in JRuby) nor do we support older versions of Ruby in Puppet 7.x. Our manual determination of which implementation class to construct is somewhat naive and PKey.read will do a better job.
Consequently, we should use PKey.read in the above code.
To make sure I'm understanding right, this ticket literally just covers replacing that conditional you linked with OpenSSL::PKey.read(pem, password)? Does this need tests or do we think whatever tests already exist are sufficient? Sorta guessing the latter, but want to make sure.
Yep just need to use PKey.read. The existing tests should be sufficient, as there are fixtures for RSA and EC keys and those tests run in MRI 2.5+ and JRuby.
However, We no longer use this code in Terminii that will be loaded in JRuby (and so don't use this code at all in JRuby) nor do we support older versions of Ruby in Puppet 7.x. Our manual determination of which implementation class to construct is somewhat naive and PKey.read will do a better job.
Consequently, we should use PKey.read in the above code.
**Note: This should only be updated for puppet7 (main branch).**
However, We no longer use this code in Terminii that will be loaded in JRuby (and so don't use this code at all in JRuby) nor do we support older versions of Ruby in Puppet 7.x. Our manual determination of which implementation class to construct is somewhat naive and PKey.read will do a better job.
Consequently, we should use PKey.read in the above code.
**Note: This should only be updated for puppet7 (main branch).**