Fix Java TLS socket reads for chunked HTTPS response bodies
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 56/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 领域
- networking
调研方向
Start with PerlOnJava’s Java-backed IO::Socket::SSL shim and the socket read path used by Net::HTTP::NB; the issue does not name source files or tests. Trace how the Java SSLSocket handles reads after response headers and compare it with the native Perl behavior. Add a deterministic local TLS test serving a chunked body; done means PerlOnJava reads the full body without a closed-filehandle error.
由索引模型根据 Issue 内容生成。
描述
Summary
PerlOnJava's Java-backed IO::Socket::SSL path can mark an HTTPS socket closed while Net::HTTP::NB is reading a chunked response body. The same request completes under system Perl with native IO::Socket::SSL/Net::SSLeay.
Reproduction and evidence
On PerlOnJava source/JAR commit 4b3ef9770 (Perl 5.44.1, Java 24.0.2, macOS arm64), a WWW::Mechanize GET to http://www.pearsoned.co.uk/Bookshop/ followed redirects to https://www.pearson.com/en-gb/higher-education/educators.html. Both runtimes sent the same User-Agent and Accept-Encoding: gzip request headers. The final response was 200 OK, Transfer-Encoding: chunked, and Content-Encoding: gzip.
With system Perl 5.42.2, LWP read the response to completion (about 379 KB). With PerlOnJava, the response body read consumed 13–15 bytes already buffered with the response headers, then the next sysread failed with sysread() on closed filehandle; the returned body was empty. PerlOnJava loads the bundled Java-backed IO::Socket::SSL shim and wraps the socket with Java SSLSocket; system Perl loaded its native SSL modules.
The CPAN run 20261103-123832-91742 showed a related visible failure in WWW-Scraper-ISBN-Pearson_Driver 0.24, t/10object.t: the expected Pearson search form was unavailable. The endpoint currently redirects to a modern Pearson page with no forms, so that live-site test is not a stable regression test. A deterministic local TLS/chunked-body regression should cover the socket read failure.
Expected and actual
Expected: PerlOnJava reads the full chunked TLS response body, matching system Perl.
Actual: a later sysread sees a closed filehandle after a small buffered prefix, and LWP returns an empty/partial body.
Related work
Issue #1435 / PR #1805 covered HTTPS response metadata and local TLS bridge coverage, not body reads. PR #1856 covered Unix datagram socket owner retention; no duplicate for this TLS/chunked read failure was found.
- 主要语言
- Perl
- 星标
- 65
- 派生
- 8
- 平均合并
- 5 小时 54 分钟
- 30 天内合并 PR
- 184
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fglock/PerlOnJava 的其他 Issue
-
area:runtime documentation enhancement
难度 2/5 1-3 小时 新手友好度 72/100
fglock/PerlOnJava#1579 ·
维护者通常 1 天内回复
-
area:backend bug
难度 4/5 3-5 天 新手友好度 55/100
fglock/PerlOnJava#1981 · 1 条评论 ·
维护者通常 1 天内回复
-
area:runtime bug
难度 4/5 3-5 天 新手友好度 57/100
fglock/PerlOnJava#1980 · 1 条评论 ·
维护者通常 1 天内回复
-
area:parser bug
难度 4/5 3-5 天 新手友好度 48/100
fglock/PerlOnJava#1979 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 52/100
fglock/PerlOnJava#1961 · 1 条评论 ·
维护者通常 1 天内回复
查看 fglock/PerlOnJava 的全部 Issue
相似的 Issue
-
check_keywords.pl dies before reporting an unknown keyword category可能已有人在做 @zhaohai666 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 87/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 72/100
libwww-perl/HTTP-Message#236 ·
-
1.severity: security
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
wave-followup
难度 2/5 1-3 小时 新手友好度 74/100