I am trying to connect to a SFTP server from cygwin. Using JSCH 1.54 When I connect from a standalone class in eclipse or compile and run the same class is CYGWIN I can connect to the server. But I am not able to connect to the server from within the application. I get algorithm negotiation failure. Below are the logs that I get when I connect to the server.
Also, this is the log that I get when I try to connect to the server from CYGWIN from within the application. It shows that the Ciphers are not available. I dont understand how is this possible when it can connect to the same server in one case and not in the other.
[exec] INFO: Local version string: SSH-2.0-JSCH-0.1.54
[exec] {} <Dec 24, 2017 3:42:54 AM GMT> < WARN> <Thread-43> <QWLogUtil>: Remote version string: SSH-2.0-OpenSSH_5.0p1+sftpfilecontrol-v1.2-hpn13v1
<QWLogUtil>: Local version string: SSH-2.0-JSCH-0.1.54
[exec] INFO: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
<QWLogUtil>: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
[exec] INFO: aes256-ctr is not available.
[exec] INFO: aes192-ctr is not available.
<QWLogUtil>: aes256-ctr is not available.
[exec] INFO: aes128-ctr is not available.
[exec] INFO: aes256-cbc is not available.
<QWLogUtil>: aes192-ctr is not available.
[exec] INFO: aes192-cbc is not available.
[exec] INFO: aes128-cbc is not available.
<QWLogUtil>: aes128-ctr is not available.
[exec] INFO: 3des-ctr is not available.
<QWLogUtil>: aes256-cbc is not available.
<QWLogUtil>: aes192-cbc is not available.
<QWLogUtil>: aes128-cbc is not available.
<QWLogUtil>: 3des-ctr is not available.
[exec] INFO: CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
<QWLogUtil>: CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
[exec] INFO: diffie-hellman-group14-sha1 is not available.
[exec] INFO: ecdh-sha2-nistp256 is not available.
<QWLogUtil>: diffie-hellman-group14-sha1 is not available.
[exec] INFO: ecdh-sha2-nistp384 is not available.
[exec] INFO: ecdh-sha2-nistp521 is not available.
<QWLogUtil>: ecdh-sha2-nistp256 is not available.
<QWLogUtil>: ecdh-sha2-nistp384 is not available.
<QWLogUtil>: ecdh-sha2-nistp521 is not available.
[exec] INFO: CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
<QWLogUtil>: CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
[exec] INFO: ecdsa-sha2-nistp256 is not available.
[exec] INFO: ecdsa-sha2-nistp384 is not available.
<QWLogUtil>: ecdsa-sha2-nistp256 is not available.
[exec] INFO: ecdsa-sha2-nistp521 is not available.
<QWLogUtil>: ecdsa-sha2-nistp384 is not available.
<QWLogUtil>: ecdsa-sha2-nistp521 is not available.
[exec] INFO: SSH_MSG_KEXINIT sent
<QWLogUtil>: SSH_MSG_KEXINIT sent
[exec] INFO: SSH_MSG_KEXINIT received
<QWLogUtil>: SSH_MSG_KEXINIT received
[exec] INFO: kex: server: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
[exec] INFO: kex: server: ssh-rsa,ssh-dss
<QWLogUtil>: kex: server: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
[exec] INFO: kex: server: aes128-ctr,aes192-ctr,aes256-ctr
[exec] INFO: kex: server: aes128-ctr,aes192-ctr,aes256-ctr
<QWLogUtil>: kex: server: ssh-rsa,ssh-dss
[exec] INFO: kex: server: hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com
[exec] INFO: kex: server: hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com
<QWLogUtil>: kex: server: aes128-ctr,aes192-ctr,aes256-ctr
[exec] INFO: kex: server: none,zlib@openssh.com
[exec] INFO: kex: server: none,zlib@openssh.com
<QWLogUtil>: kex: server: aes128-ctr,aes192-ctr,aes256-ctr
<QWLogUtil>: kex: server: hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com
<QWLogUtil>: kex: server: hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com
<QWLogUtil>: kex: server: none,zlib@openssh.com
[exec] INFO: kex: client: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
<QWLogUtil>: kex: server: none,zlib@openssh.com
[exec] INFO: kex: client: ssh-rsa,ssh-dss
[exec] INFO: kex: client: 3des-cbc,blowfish-cbc
[exec] INFO: kex: client: 3des-cbc,blowfish-cbc
<QWLogUtil>: kex: client: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
[exec] INFO: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
[exec] INFO: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
<QWLogUtil>: kex: client: ssh-rsa,ssh-dss
<QWLogUtil>: kex: client: 3des-cbc,blowfish-cbc
[exec] INFO: kex: client: none
<QWLogUtil>: kex: client: 3des-cbc,blowfish-cbc
[exec] INFO: kex: client: none
<QWLogUtil>: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
<QWLogUtil>: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
<QWLogUtil>: kex: client: none
[exec] INFO: Disconnecting from SERVER.com port 22
<QWLogUtil>: Disconnecting from SERVER.com port 22
[exec] com.jcraft.jsch.JSchException: Algorithm negotiation fail