Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

How to test `OpenSSL::SSL::SSLContext#add_certificate`?

未關閉
#516 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
ruby

研究方向

首先使用 OpenSSL::SSL::SSLContext#add_certificate 執行提供的 Ruby 重現程式,然後將 #key 和 #cert 的結果與文件中記載的已棄用寫入方法的結果進行比較。追蹤 SSLContext API 的行為,並判斷檢查是否應該正常運作,或文件是否應該說明 nil 結果;相應地更新相關測試或文件。

由索引模型根據 Issue 內容生成。

描述

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)
主要語言
C
星號
276
分支
200
平均合併
15 小時 35 分鐘
30 天內合併 PR
7

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ruby/openssl 的其他 Issue

查看 ruby/openssl 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。