Net::HTTP doesn't allow to set SSL options
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- ruby
- 领域
- networking, security
调研方向
首先阅读 Net::HTTP 的 SSL 配置路径,以及它目前公开的 SSLContext 字段。将该接口与已报告的 SSLContext 选项需求进行比较,并查看包含七条评论的讨论,以了解对 API 的预期。完成的标准是确定一种范围明确的方式,为单个 Net::HTTP 连接配置 SSL 选项,同时不更改全局默认值。
由索引模型根据 Issue 内容生成。
描述
Context
Since OpenSSL 3.x, when a server close the TCP connection without first calling SSL_shutdown, the SSL client now error with SSL_read: unexpected eof while reading.
In OpenSSL 1.x, the client wouldn't mind and would behave like if the connection was cleanly closed.
To restore the 1.x behavior, you can set a specific options:
ssl_context = OpenSSL::SSL::SSLContext.new
ssl_context.options |= OpenSSL::SSL::OP_IGNORE_UNEXPECTED_EOF
Problem
The issue is that Net::HTTP only allow to set specific fields on the SSLContext object, and options is not one of them.
Workaround
The issue can be worked around by changing the default options globally:
if OpenSSL::SSL.const_defined?(:OP_IGNORE_UNEXPECTED_EOF)
OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:options] |= OpenSSL::SSL::OP_IGNORE_UNEXPECTED_EOF
end
However this impact all SSL connections, not just the ones that need it.
Solution
Not sure what the best API would be. But it would be great if we could directly pass a SSLContext instance to Net::HTTP, so that we're not limited on the SSL configuration.
- 主要语言
- Ruby
- 星标
- 148
- 派生
- 95
- 平均合并
- 3 小时 34 分钟
- 30 天内合并 PR
- 2
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ruby/net-http 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 38/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
相似的 Issue
-
security
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
OSCON 2016未关闭content
难度 2/5 1-3 小时 新手友好度 68/100
rubyevents/rubyevents#2148 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
we-promise/sure#3838 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
simp/pupmod-simp-pam#244 ·
维护者通常 7 天内回复
-
Mend: dependency security vulnerability
难度 2/5 1-3 小时 新手友好度 68/100
ManageIQ/manageiq-ui-classic#10341 ·
维护者通常 1 天内回复