How to test `OpenSSL::SSL::SSLContext#add_certificate`?
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 276
- Forks
- 200
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 7
Description
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
nil
nil
Version
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]openssl (default: 3.0.0)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided Ruby reproduction with OpenSSL::SSL::SSLContext#add_certificate, then compare the results of #key and #cert with the documented deprecated writers. Trace the SSLContext API behavior and determine whether inspection should work or whether the documentation should explain the nil results; update the relevant tests or documentation accordingly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- cryptography, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100