Skip to content

Run hostname verifier on FTPS data connection#404

Merged
garydgregory merged 2 commits into
apache:masterfrom
dxbjavid:ftps-data-hostname-verify
Jul 18, 2026
Merged

Run hostname verifier on FTPS data connection#404
garydgregory merged 2 commits into
apache:masterfrom
dxbjavid:ftps-data-hostname-verify

Conversation

@dxbjavid

Copy link
Copy Markdown
Contributor

When a hostname verifier is installed through setHostnameVerifier, FTPSClient only runs it during the control-connection handshake in sslNegotiation; the data connection opened for each transfer completes its TLS handshake in openDataConnection without ever calling the verifier. As the default trust manager only checks that the certificate is in date and not that the name matches, an in-path attacker on the data port can present any unexpired certificate and the transferred bytes are read or altered even though the caller asked for the server identity to be checked. This runs the same verifier against hostname on the data socket after its handshake, so the data channel honours the check already applied to the control channel.

@garydgregory garydgregory changed the title run hostname verifier on FTPS data connection Run hostname verifier on FTPS data connection Jul 18, 2026
@garydgregory
garydgregory merged commit a797294 into apache:master Jul 18, 2026
11 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants