davsclaus opened a new pull request, #24757:
URL: https://github.com/apache/camel/pull/24757
## Summary
`SftpOperations.createSession()` applied the `ciphers` and
`keyExchangeProtocols` endpoint options via `JSch.setConfig(...)` — which is
**static and JVM-global** — on every (re)connect. This caused cross-endpoint
contamination: one endpoint's cipher/kex settings permanently altered the JSch
defaults for every other SFTP endpoint in the JVM.
This PR moves both options to use `session.setConfig(...)` (per-session),
consistent with every other option in the same method (`StrictHostKeyChecking`,
`compression.*`, `PreferredAuthentications`, `server_host_key`,
`PubkeyAcceptedAlgorithms`, `kex`, `ca_signature_algorithms`).
**Changes:**
- Replace `JSch.setConfig(ciphers)` (global) with
`session.setConfig("cipher.s2c"/cipher.c2s", ...)` (per-session)
- Replace `JSch.setConfig("kex", ...)` (global) with
`session.setConfig("kex", ...)` (per-session)
- Remove unused `Hashtable` import
## Test plan
- [x] New `SftpCipherGlobalConfigIT` — records JSch global defaults, sends a
message through an endpoint with custom ciphers and kex, asserts the globals
are unchanged
- [x] Existing `SftpSetCipherIT` passes (functional cipher test)
- [x] Existing `SftpKeyExchangeProtocolsIT` passes (functional kex test)
- [x] Full `mvn verify` on `camel-ftp` passes
_Claude Code on behalf of davsclaus_
--
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]