The documentation for SSLContext states that the #key= and #cert= writer methods are deprecated and to instead use #add_certificate. However, I noticed there does not seem to be a way to inspect the added key and cert objects? Both #key and #cert both return nil after calling #add_certificate.
Steps To Reproduce
key = OpenSSL::PKey::RSA.new(File.read('ssl.key'))
cert = OpenSSL::X509::Certificate.new(File.read('ssl.crt'))
context = OpenSSL::SSL::SSLContext.new
context.add_certificate(cert,key)
p context.key
p context.cert
Expected Results
#<OpenSSL::PKey::RSA: ...>
#<OpenSSL::X509::Certificate: ...>
Actual Results
Version
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
openssl (default: 3.0.0)
The documentation for SSLContext states that the
#key=and#cert=writer methods are deprecated and to instead use#add_certificate. However, I noticed there does not seem to be a way to inspect the addedkeyandcertobjects? Both#keyand#certboth returnnilafter calling#add_certificate.Steps To Reproduce
Expected Results
Actual Results
Version
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]openssl (default: 3.0.0)