SSLSocket#syswrite no longer raises IOError after IO#close
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by tracing how SSLSocket#syswrite reaches SSL_write() and how the underlying socket's close is handled, using the reported regression from #1105 as context. Reproduce the supplied UNIXSocket pair example, then add or locate a regression test that checks writing after close raises IOError; the issue names no source or test files, so expect to read around the socket implementation first.
由索引模型根据 Issue 内容生成。
描述
Since bf1a41904e051d31dbb1648019787fe336cec1c8 (#1105), SSLSocket#syswrite no longer raises IOError after IO#close on the underlying socket. SSL_write() still uses the old file descriptor number, so if a new socket gets the same number, the TLS record goes to the new socket.
require "openssl"
require "socket"
key = OpenSSL::PKey::EC.generate("prime256v1")
cert = OpenSSL::X509::Certificate.new
cert.public_key = key
cert.not_before = cert.not_after = Time.now
cert.sign(key, "SHA256")
ctx = OpenSSL::SSL::SSLContext.new
ctx.add_certificate(cert, key)
s1, s2 = UNIXSocket.pair
Thread.new { OpenSSL::SSL::SSLSocket.new(s1, ctx).accept }
ssl = OpenSSL::SSL::SSLSocket.new(s2)
ssl.connect
fd = s2.fileno
s2.close
a, b = UNIXSocket.pair
a.fileno == fd #=> true
ssl.syswrite("hello") #=> 5
b.read_nonblock(100) #=> "\x17\x03\x03\x00\x16..."
I checked the open PRs, but none of them corrects the issue.
- 主要语言
- C
- 星标
- 276
- 派生
- 205
- 平均合并
- 21 小时 17 分钟
- 30 天内合并 PR
- 17
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ruby/openssl 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Add OpenSSL::SSL::SSLContext#client_hello_cb= (binding for SSL_CTX_set_client_hello_cb())可能已有人在做 @kou 于 37 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 53/100
维护者通常 1 天内回复
-
Documenting how to use OpenSSL::SSL::SSLContext in PQC use cases可能已有人在做 @junaruga 于 23 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 55/100
维护者通常 1 天内回复
-
Expose XOFs like SHAKE128 and SHAKE256可能已有人在做 @rhenium 于 133 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
isolation2 lockmodes fails on cassert builds: extra AccessShareLock on partition root可能已有人在做 @tuhaihe 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
apache/cloudberry#2356 ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 86/100
-
难度 1/5 1-3 小时 新手友好度 78/100
crosspoint-reader/crosspoint-reader#4535 ·
维护者通常 1 天内回复
-
[core] Clients never advertise RNS_UD_CS_SUPPORT_ERRINFO_PDU, so a conforming server can't send them Set Error Info可能已有人在做 @akallabeth 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
FreeRDP/FreeRDP#14230 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
Genymobile/scrcpy#7178 ·
维护者通常 3 天内回复