acho-bacho opened a new issue, #376:
URL: https://github.com/apache/mina-sshd/issues/376

   ### Version
   
   2.10
   
   ### Bug description
   
   Hello,
   
   we are using sfp client from Latest SSHD Release (2.10) binaries and try to 
connect to a sFTP server through a SQUID http proxy but it fails with:
   ```
   C:\apache-sshd-2.10.0\apache-sshd-2.10.0\bin>sftp.bat [email protected] -w 
password -J 10.83.51.147:3128
   2023-05-19: INFO   : org.apache.sshd.common.util.secu: 
getOrCreateProvider(EdDSA) created instance of 
net.i2p.crypto.eddsa.EdDSASecurityProvider
   2023-05-19: WARNING: org.apache.sshd.client.future.De: 
notifyListener(DefaultConnectFuture[id=null@/10.83.51.147:3128][value=ClientSessionImpl[null@/10.83.51.147:3128]])
 failed (IllegalStateException) to invoke 
org.apache.sshd.client.SshClient$$Lambda$176/0x0000000100208440@2ee6a988: No 
username specified when the session was created
   2023-05-19: WARNING: org.apache.sshd.client.session.C: 
exceptionCaught(ClientSessionImpl[null@/10.83.51.147:3128])[state=Opened] 
StreamCorruptedException: Incorrect identification (line too long):  at line 
157: <p>Your cache administrator is <a 
href="mailto:root?subject=CacheErrorInfo%20-%20ERR_INVALID_REQ&amp;body=CacheHost%3A%20ip-10-83-51-147.eu-west-1.compute.internal%0D%0AErrPage%3A%20ERR_INVALID_REQ%0D%0AErr%3A%20%5Bnone%5D%0D%0ATimeStamp%3A%20Fri,%2019%20M
   Exception in thread "main" org.apache.sshd.common.SshException: 
DefaultConnectFuture[[email protected]/194.108.117.16:22]: Failed to get 
operation result within specified timeout: 120000 msec
           at 
org.apache.sshd.common.future.AbstractSshFuture.lambda$verifyResult$1(AbstractSshFuture.java:114)
           at 
org.apache.sshd.common.future.AbstractSshFuture.formatExceptionMessage(AbstractSshFuture.java:206)
           at 
org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:114)
           at 
org.apache.sshd.client.future.DefaultConnectFuture.verify(DefaultConnectFuture.java:55)
           at 
org.apache.sshd.client.future.DefaultConnectFuture.verify(DefaultConnectFuture.java:36)
           at 
org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:74)
           at 
org.apache.sshd.cli.client.SshClientCliSupport.setupClientSession(SshClientCliSupport.java:262)
           at 
org.apache.sshd.cli.client.SftpCommandMain.main(SftpCommandMain.java:371)
   Caused by: java.util.concurrent.TimeoutException: Timed out after 120000 msec
           at 
org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:113)
           ... 5 more
   ```
   
   I do not pass a username to the -J (proxyJump) parameter as the Squid proxy 
does not require a username.
   
   Providing a fake username gives me:
   `C:\apache-sshd-2.10.0\apache-sshd-2.10.0\bin>sftp.bat [email protected] 
-w password -J [email protected]:3128
   2023-05-19: INFO   : org.apache.sshd.common.util.secu: 
getOrCreateProvider(EdDSA) created instance of 
net.i2p.crypto.eddsa.EdDSASecurityProvider
   Exception in thread "main" org.apache.sshd.common.SshException: 
DefaultConnectFuture[[email protected]/194.108.117.16:22]: Failed 
(StreamCorruptedException) to execute: Incorrect identification (line too 
long):  at line 157: <p>Your cache administrator is <a 
href="mailto:root?subject=CacheErrorInfo%20-%20ERR_INVALID_REQ&amp;body=CacheHost%3A%20ip-10-83-51-147.eu-west-1.compute.internal%0D%0AErrPage%3A%20ERR_INVALID_REQ%0D%0AErr%3A%20%5Bnone%5D%0D%0ATimeStamp%3A%20Fri,%2019%20M
           at 
org.apache.sshd.common.future.AbstractSshFuture.lambda$verifyResult$2(AbstractSshFuture.java:146)
           at 
org.apache.sshd.common.future.AbstractSshFuture.formatExceptionMessage(AbstractSshFuture.java:206)
           at 
org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:145)
           at 
org.apache.sshd.client.future.DefaultConnectFuture.verify(DefaultConnectFuture.java:55)
           at 
org.apache.sshd.client.future.DefaultConnectFuture.verify(DefaultConnectFuture.java:36)
           at 
org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:74)
           at 
org.apache.sshd.cli.client.SshClientCliSupport.setupClientSession(SshClientCliSupport.java:262)
           at 
org.apache.sshd.cli.client.SftpCommandMain.main(SftpCommandMain.java:371)
   Caused by: java.io.StreamCorruptedException: Incorrect identification (line 
too long):  at line 157: <p>Your cache administrator is <a 
href="mailto:root?subject=CacheErrorInfo%20-%20ERR_INVALID_REQ&amp;body=CacheHost%3A%20ip-10-83-51-147.eu-west-1.compute.internal%0D%0AErrPage%3A%20ERR_INVALID_REQ%0D%0AErr%3A%20%5Bnone%5D%0D%0ATimeStamp%3A%20Fri,%2019%20M
           at 
org.apache.sshd.common.session.helpers.SessionHelper.doReadIdentification(SessionHelper.java:913)
           at 
org.apache.sshd.client.session.AbstractClientSession.readIdentification(AbstractClientSession.java:509)
           at 
org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:477)
           at 
org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:64)
           at 
org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:407)
           at 
org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:380)
           at 
org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:375)
           at 
org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:38)
           at java.base/java.security.AccessController.doPrivileged(Native 
Method)
           at 
org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37)
           at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:127)
           at java.base/sun.nio.ch.Invoker$2.run(Invoker.java:219)
           at 
java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
           at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
           at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
           at java.base/java.lang.Thread.run(Thread.java:834)`
   
   Without using the Squid proxy jump I am able to connect to the public sftp 
server:
   `C:\apache-sshd-2.10.0\apache-sshd-2.10.0\bin>sftp.bat [email protected] 
-w password
   2023-05-19: INFO   : org.apache.sshd.common.util.secu: 
getOrCreateProvider(EdDSA) created instance of 
net.i2p.crypto.eddsa.EdDSASecurityProvider
   2023-05-19 17:56:35,800 INFO main Using factory=DefaultSftpClientFactory
   2023-05-19 17:56:35,815 INFO main Using version selector=CURRENT
   / > ls
       .    0    drwx------
       ..    0    drwx------
       pub    0    drwx------
       readme.txt    405    -rw-------
   / >
   `
   
   Do you have any ideas what might be wrong?
   
   ### Actual behavior
   
   sftp client fails to connect to an sFTP server via Squid HTTP proxy
   
   ### Expected behavior
   
   sftp client SHOULD  connect to an sFTP server via Squid HTTP proxy 
   
   ### Relevant log output
   
   ```Shell
   C:\apache-sshd-2.10.0\apache-sshd-2.10.0\bin>sftp.bat [email protected] -w 
password -J 10.83.51.147:3128
   2023-05-19: INFO   : org.apache.sshd.common.util.secu: 
getOrCreateProvider(EdDSA) created instance of 
net.i2p.crypto.eddsa.EdDSASecurityProvider
   2023-05-19: WARNING: org.apache.sshd.client.future.De: 
notifyListener(DefaultConnectFuture[id=null@/10.83.51.147:3128][value=ClientSessionImpl[null@/10.83.51.147:3128]])
 failed (IllegalStateException) to invoke 
org.apache.sshd.client.SshClient$$Lambda$176/0x0000000100208440@2ee6a988: No 
username specified when the session was created
   2023-05-19: WARNING: org.apache.sshd.client.session.C: 
exceptionCaught(ClientSessionImpl[null@/10.83.51.147:3128])[state=Opened] 
StreamCorruptedException: Incorrect identification (line too long):  at line 
157: <p>Your cache administrator is <a 
href="mailto:root?subject=CacheErrorInfo%20-%20ERR_INVALID_REQ&amp;body=CacheHost%3A%20ip-10-83-51-147.eu-west-1.compute.internal%0D%0AErrPage%3A%20ERR_INVALID_REQ%0D%0AErr%3A%20%5Bnone%5D%0D%0ATimeStamp%3A%20Fri,%2019%20M
   Exception in thread "main" org.apache.sshd.common.SshException: 
DefaultConnectFuture[[email protected]/194.108.117.16:22]: Failed to get 
operation result within specified timeout: 120000 msec
           at 
org.apache.sshd.common.future.AbstractSshFuture.lambda$verifyResult$1(AbstractSshFuture.java:114)
           at 
org.apache.sshd.common.future.AbstractSshFuture.formatExceptionMessage(AbstractSshFuture.java:206)
           at 
org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:114)
           at 
org.apache.sshd.client.future.DefaultConnectFuture.verify(DefaultConnectFuture.java:55)
           at 
org.apache.sshd.client.future.DefaultConnectFuture.verify(DefaultConnectFuture.java:36)
           at 
org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:74)
           at 
org.apache.sshd.cli.client.SshClientCliSupport.setupClientSession(SshClientCliSupport.java:262)
           at 
org.apache.sshd.cli.client.SftpCommandMain.main(SftpCommandMain.java:371)
   Caused by: java.util.concurrent.TimeoutException: Timed out after 120000 msec
           at 
org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:113)
           ... 5 more
   
   C:\apache-sshd-2.10.0\apache-sshd-2.10.0\bin>sftp.bat [email protected] -w 
password -J [email protected]:3128
   2023-05-19: INFO   : org.apache.sshd.common.util.secu: 
getOrCreateProvider(EdDSA) created instance of 
net.i2p.crypto.eddsa.EdDSASecurityProvider
   Exception in thread "main" org.apache.sshd.common.SshException: 
DefaultConnectFuture[[email protected]/194.108.117.16:22]: Failed 
(StreamCorruptedException) to execute: Incorrect identification (line too 
long):  at line 157: <p>Your cache administrator is <a 
href="mailto:root?subject=CacheErrorInfo%20-%20ERR_INVALID_REQ&amp;body=CacheHost%3A%20ip-10-83-51-147.eu-west-1.compute.internal%0D%0AErrPage%3A%20ERR_INVALID_REQ%0D%0AErr%3A%20%5Bnone%5D%0D%0ATimeStamp%3A%20Fri,%2019%20M
           at 
org.apache.sshd.common.future.AbstractSshFuture.lambda$verifyResult$2(AbstractSshFuture.java:146)
           at 
org.apache.sshd.common.future.AbstractSshFuture.formatExceptionMessage(AbstractSshFuture.java:206)
           at 
org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:145)
           at 
org.apache.sshd.client.future.DefaultConnectFuture.verify(DefaultConnectFuture.java:55)
           at 
org.apache.sshd.client.future.DefaultConnectFuture.verify(DefaultConnectFuture.java:36)
           at 
org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:74)
           at 
org.apache.sshd.cli.client.SshClientCliSupport.setupClientSession(SshClientCliSupport.java:262)
           at 
org.apache.sshd.cli.client.SftpCommandMain.main(SftpCommandMain.java:371)
   Caused by: java.io.StreamCorruptedException: Incorrect identification (line 
too long):  at line 157: <p>Your cache administrator is <a 
href="mailto:root?subject=CacheErrorInfo%20-%20ERR_INVALID_REQ&amp;body=CacheHost%3A%20ip-10-83-51-147.eu-west-1.compute.internal%0D%0AErrPage%3A%20ERR_INVALID_REQ%0D%0AErr%3A%20%5Bnone%5D%0D%0ATimeStamp%3A%20Fri,%2019%20M
           at 
org.apache.sshd.common.session.helpers.SessionHelper.doReadIdentification(SessionHelper.java:913)
           at 
org.apache.sshd.client.session.AbstractClientSession.readIdentification(AbstractClientSession.java:509)
           at 
org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:477)
           at 
org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:64)
           at 
org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:407)
           at 
org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:380)
           at 
org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:375)
           at 
org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:38)
           at java.base/java.security.AccessController.doPrivileged(Native 
Method)
           at 
org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37)
           at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:127)
           at java.base/sun.nio.ch.Invoker$2.run(Invoker.java:219)
           at 
java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
           at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
           at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
           at java.base/java.lang.Thread.run(Thread.java:834)`
   
   
   C:\apache-sshd-2.10.0\apache-sshd-2.10.0\bin>sftp.bat [email protected] -w 
password
   2023-05-19: INFO   : org.apache.sshd.common.util.secu: 
getOrCreateProvider(EdDSA) created instance of 
net.i2p.crypto.eddsa.EdDSASecurityProvider
   2023-05-19 17:56:35,800 INFO main Using factory=DefaultSftpClientFactory
   2023-05-19 17:56:35,815 INFO main Using version selector=CURRENT
   / > ls
       .    0    drwx------
       ..    0    drwx------
       pub    0    drwx------
       readme.txt    405    -rw-------
   / >
   ```
   
   
   ### Other information
   
   _No response_


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to