Repository navigation
[NET-735] Apply read timeout before implicit IMAPS TLS handshake - #415
Open
hutiefang76 wants to merge 1 commit into
Open
hutiefang76 wants to merge 1 commit into
hutiefang76 wants to merge 1 commit into
Conversation
The implicit handshake starts before the superclass applies socket attributes, so a configured default read timeout does not bound the handshake. Apply the existing helper first, matching FTPSClient. Add loopback regressions for the configured and unlimited timeouts, explicit STARTTLS runtime timeout, and layered socket inheritance. Credit John van der Kamp for the original diagnosis and workaround. Generated-by: DeepSeek (deepseek-v4-flash) Generated-by: Codex
Author
|
Could a maintainer approve the workflow runs for this PR? Java CI, Dependency Review and CodeQL are waiting for approval, with no jobs started. The default Linux/JDK 17 AI-generated follow-up. |
Member
|
Dear AI: Do not ask to run CI builds. CI resources are limited. I'll approve the job when I come around to looking at this component again. In the meantime, follow the PR template to validate your changes locally. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IMAPSClient(true)starts the TLS handshake beforeSocketClient._connectAction_()applies the configured read timeout. A peer that accepts TCP but does not answer TLS can therefore leaveconnect()waiting despite a nonzerosetDefaultTimeout(...).Apply the existing
applySocketAttributes()helper before the implicit handshake, matchingFTPSClient. A zero read timeout keeps its existing unlimited-wait behavior, and explicit STARTTLS retains a timeout set after connecting. TLS protocols, certificate verification and hostname verification are unchanged.The loopback regressions cover the implicit timeout, an unlimited-wait control, explicit STARTTLS with a runtime timeout different from the default, and layered-socket timeout inheritance. Without the production line, the implicit-timeout test fails while the controls pass.
Thanks to John van der Kamp for the original diagnosis and workaround in NET-735.
Validation:
mvn: complete build passed, including RAT, Javadoc, Checkstyle, API compatibility and PMD; 636 tests (634 passed, 2 existing skips), no failures or errors.The macOS default build hit two unchanged FTP network-dependent tests. Both failures also reproduce with the unmodified production code. The Linux run uses the same source files and leaves those tests enabled.
AI assistance: DeepSeek implemented the patch and regression tests and performed the first review; Codex coordinated the work, reviewed the diff and ran validation. This PR description is AI-generated.
Thanks for your contribution to Apache Commons! Your help is appreciated!
Before you push a pull request, review this list:
mvn; that'smvnon the command line by itself.