slachiewicz opened a new pull request, #978: URL: https://github.com/apache/maven-wagon/pull/978
`FtpsWagon` encrypted the control channel and left the data channel clear, so a server that requires protection refused every transfer with `425 Server requires protected data connection`. Nothing in `wagon-ftp` sent `PBSZ` or `PROT`. Fixes #651. `PROT` can only be sent once the session is authenticated, so this adds an `afterLogin` hook to `FtpWagon` — a no-op for plain FTP — and overrides it in `FtpsWagon` to send `PBSZ 0` then `PROT`, in the order RFC 4217 requires. The default is `P`. A caller who asked for FTPS asked for a protected transfer, and until now got a clear one. `dataChannelProtection` accepts `C` for the previous behaviour, or empty to send no `PROT` at all and leave the server on its default — happy to flip the default if you would rather this were opt-in on a maintenance line. Verified: `mvn test -pl wagon-providers/wagon-ftp` → 27 tests, 0 failures. `FtpsWagonTest` covers the default, a configured level and the disabled case against a client that records the commands instead of sending them; `FtpWagonTest.testAfterLoginIsCalledOnConnect` covers the hook being called, against the embedded server. Negative controls: dropping the `execPROT` call turns 2 of the 3 `FtpsWagonTest` cases red, and dropping the `afterLogin(ftp)` call turns the wiring test red. `spotless:check` passes. *This change was created with AI assistance.* -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
