2024-05-28
| ||
00:30 | • Ticket [88c0c84969] EOF handling potentially broken with OpenSSL 1.1.1e or newer status still Open with 4 other changes artifact: 28d32ca3e2 user: bohagan | |
2024-01-01
| ||
12:32 | • Ticket [88c0c84969]: 3 changes artifact: 9bf50203b7 user: Avalanchee | |
2023-11-14
| ||
09:58 | • Ticket [88c0c84969]: 3 changes artifact: 2f9a729234 user: gustafn3 | |
2023-11-10
| ||
21:15 | • Ticket [88c0c84969]: 5 changes artifact: 515aa59d81 user: azazel | |
2023-10-22
| ||
11:55 | • New ticket [88c0c84969]. artifact: 639511f397 user: gustafn3 | |
Ticket Hash: | 88c0c8496999c48f513eb4f97aaa0ac9829b35d3 | |||
Title: | EOF handling potentially broken with OpenSSL 1.1.1e or newer | |||
Status: | Open | Type: | Code Defect | |
Severity: | Critical | Priority: | Immediate | |
Subsystem: | Resolution: | Open | ||
Last Modified: | 2024-05-28 00:30:50 | |||
Version Found In: | 1.8 | |||
User Comments: | ||||
gustafn3 added on 2023-10-22 11:55:59:
The EOF handling has changed in OpenSSL 1.1.1e, where it changed from SSL_ERROR_SYSCALL with errno 0 to SSL_ERROR_SSL with reason code SSL_R_UNEXPECTED_EOF_WHILE_READING [1]. This change in OpenSSL requires also adjustments in applications using OpenSSL (see, e.g., [2]), including tcltls. We noticed the problem when upgrading a machine from CentOS 7 to Rocky Linux 9, where after the upgrade a script like the following stopped working:
The problem manifests itself in the "read" operation, where first, it transfers the full content, and then it reports "software caused connection abort". See below the output from the debug macros of tcltls.
The problem exists not only on Linux, but as well on macOS (13.6) Below is a patch that fixes the problem without going into the (version dependent) error code / error reason handling of OpenSSL, since this approach makes the issue more transparent. This patch below was tested with Tcl 8.6.13, tcltls-1.7.22 and OpenSSL 3.1.3 (19 Sep 2023).
[1] https://mta.openssl.org/pipermail/openssl-project/2020-May/001975.html azazel added on 2023-11-10 21:15:10: There is an SSL option governing this behaviour:
My initial thought was unconditionally to set the option:
However, given that this change in behaviour was intended to reveal errors that were previously unreported, I think it may make sense to add an option (this is what openssl did for s_client): e.g., gustafn3 added on 2023-11-14 09:58:13: I am not arguing about the changed behavior in OpenSSL about of the unexpected EOF handling (which hit many projects). No matter how the default should be, the old EOF handling of tcltls (relying on error states) is not ok and lead to a breaking behavior for us when upgrading OS versions. My suggested fix makes EOF handling clear, more robust, and avoids the error situation. The decision to set SSL_OP_IGNORE_UNEXPECTED_EOF or not (and maybe making it configurable) is independent of this. Avalanchee added on 2024-01-01 12:32:52: Is this project dead? I mean I'm very thankful for the active participants here, so I was able to compile the patch into my deployment. However this is a breaking bug that should be handled with utmost urgency. From looking at the timeline it doesn't seem like anyone is maintaining this project, am I wrong? I would like to kindly ask to promote this fix into release, and also the "feature-dump-keys" branch if possible. Thanks. bohagan added on 2024-05-28 00:30:50: This should be fixed by the changes in [5a33efb87bd3750f]. I tested with a few files that were reported to have the issue, and they worked. Please test with the trunk version and let me know if you you have any URLs that still fail due to the unexpected EOF. Thanks. |