davsclaus commented on code in PR #31005:
URL: https://github.com/apache/camel/pull/31005#discussion_r4723733017


##########
components/camel-jsch/src/main/java/org/apache/camel/component/scp/ScpComponent.java:
##########
@@ -74,11 +74,20 @@ public void setVerboseLogging(boolean verboseLogging) {
         this.verboseLogging = verboseLogging;
     }
 
+    /**
+     * The logger that the JSch instance of each session of the endpoints of 
this component logs with.
+     */
+    public Logger getJschLogger() {

Review Comment:
   Changed in 3f7326727c10: `getJschLogger()` is now package-private, as only 
`ScpOperations` of the same package calls it, so it is not part of the public 
API of the component. A subclass that overrides `initJsch()` without calling 
super gets no per-instance logger, and its sessions log with the static JSch 
logger, which is what it got before this PR; the Javadoc now says so.
   
   _Claude Code on behalf of Claus Ibsen_



##########
components/camel-jsch/src/main/java/org/apache/camel/component/scp/ScpOperations.java:
##########
@@ -393,6 +393,16 @@ private Session createSession(ScpConfiguration config) {
             session = jsch.getSession(config.getUsername(), config.getHost(), 
config.getPort());
             session.setTimeout(config.getTimeout());
             session.setUserInfo(new SessionUserInfo(config));
+            if (ObjectHelper.isNotEmpty(config.getCiphers())) {
+                // on the session: JSch.setConfig would change the ciphers of 
every JSch session in the JVM
+                LOG.trace("Using ciphers: {}", config.getCiphers());
+                session.setConfig("cipher.s2c", config.getCiphers());
+                session.setConfig("cipher.c2s", config.getCiphers());
+            }
+            if (config.getPassword() != null) {
+                // JSch answers a keyboard-interactive password prompt only 
with the password of the session
+                session.setPassword(config.getPassword());

Review Comment:
   Added in 3f7326727c10: the comment at `session.setPassword()` explains that 
JSch answers a keyboard-interactive request of one non-echoed question 
containing `password:` with the session password without calling 
`promptKeyboardInteractive()`, and the comment in `promptKeyboardInteractive()` 
says that returning null only cancels the other questions, and that it must not 
return the password.
   
   _Claude Code on behalf of Claus Ibsen_



##########
components/camel-jsch/src/main/java/org/apache/camel/component/scp/ScpComponent.java:
##########
@@ -74,11 +74,20 @@ public void setVerboseLogging(boolean verboseLogging) {
         this.verboseLogging = verboseLogging;
     }
 
+    /**
+     * The logger that the JSch instance of each session of the endpoints of 
this component logs with.

Review Comment:
   Reworded in 3f7326727c10 as suggested, with a note on when it returns null.
   
   _Claude Code on behalf of Claus Ibsen_



-- 
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]

Reply via email to