-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FTPES with TLS Session Reuse for FileZilla Server (need also BouncyCastle and a subclass). #321
base: master
Are you sure you want to change the base?
Conversation
…and a subclass). Connecting to ftp.example.com on the command port and then to the corresponding IP x.x.x.x on the data port prevents the server from accepting the same TLS session. Therefore, the Filezilla server needs to set peerHost before socket.connect to allow TLS session resumption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @deguich
There are 2 issues with this PR:
- No tests:
- This is just an invitation for future changes to inadvertently undo or break the behavior in this PR. A test should fail if the changes to
main
are not applied. - Look at the existing tests for inspiration here and in other Commons components
- If this is a FileZilla specific change, you might need to run a test that runs FileZilla in Docker using a Docker Maven plugin like https://github.com/fabric8io/docker-maven-plugin
- This is just an invitation for future changes to inadvertently undo or break the behavior in this PR. A test should fail if the changes to
- You did not follow the instructions in the PR template: You did not run
mvn
by itself or you would have caught this build failure:
[INFO] --- checkstyle:3.6.0:check (default-cli) @ commons-net ---
[INFO] There are 3 errors reported by Checkstyle 10.21.1 with src/conf/checkstyle.xml ruleset.
[ERROR] src\main\java\org\apache\commons\net\ftp\FTPSClient.java:[315] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src\main\java\org\apache\commons\net\ftp\FTPSClient.java:[834] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src\main\java\org\apache\commons\net\ftp\FTPSClient.java:[876] (regexp) RegexpSingleline: Line has trailing spaces.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
@@ -313,7 +312,7 @@ protected Socket _openDataConnection_(final String command, final String arg) th | |||
*/ | |||
protected void _prepareDataSocket_(final Socket socket) throws IOException { | |||
} | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No extra whitespace please.
…(with SNI) in passive mode.
You can enable SNI (Server Name Indication) test by using external filezilla server (SSL session reuse always works when using docker on localhost and bouncycastle lib) : src\test\resources\org\apache\commons\net\filezillaserver\filezillaserver.properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing and testing... All Javadoc changes in FTPSClient are formatting changes and makes the PR harder to review, this PR should not change style.
<version>1.7.32</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<!--<dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this comment block.
</excludes> | ||
<environmentVariables> | ||
<TRACE_CALLS>${commons.net.trace_calls}</TRACE_CALLS> | ||
<ADD_LISTENER>${commons.net.add_listener}</ADD_LISTENER> | ||
</environmentVariables> | ||
</configuration> | ||
</plugin> | ||
<!-- Plugin Failsafe for integration-tests --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to state what a plugin is.
Hello @deguich
|
Connecting to ftp.example.com on the command port and then to the corresponding IP x.x.x.x on the data port prevents the server from accepting the same TLS session. Therefore, the Filezilla server needs to set peerHost before socket.connect to allow TLS session resumption.
With this new version, FTPeS to the server with TLS session resumption works with this subclass :