Archived Forum Post

Index of archived forum posts

Question:

SFTP error "Expected KEX_DH_GEX_GROUP"

Sep 07 '13 at 03:30

Hi, I am trying to connect to an SFTP but am getting the following error from Chilkat in the function sftp.Connect(hostname, port)...


DllDate: Dec 22 2010 UnlockPrefix: * Username: Component: .NET 2.0 SftpVersion: 0 hostname: ... port: 22 ConnectTimeoutMs: 50000

calling ConnectSocket2 This is an IPV4 numeric address... Connect using IPV4. ipAddress: ...* socketHandle: 0x804 ai_addrlen: 16 ai_addr: 0200 0016 4B7F 64D8 0000 0000 0000 0000

myIP_3: **.***.***.***
myPort_3: *****
connect successful.
Established TCP/IP connection with SSH server
clientIdentifier: SSH-2.0-PuTTY_Local:_May_11_2009_17:22:38
initialDataFromSshServer: SSH-2.0-0.0

serverVersion: SSH-2.0-0.0 
KeyExchangeAlgs:
  algorithm: diffie-hellman-group1-sha1
  algorithm: diffie-hellman-group-exchange-sha1
  algorithm: diffie-hellman-group14-sha1
HostKeyAlgs:
  algorithm: ssh-dss
EncCS:
  algorithm: aes256-cbc
  algorithm: aes192-cbc
  algorithm: aes128-cbc
  algorithm: twofish-cbc
  algorithm: blowfish-cbc
  algorithm: 3des-cbc
  algorithm: arcfour
EncSC:
  algorithm: aes256-cbc
  algorithm: aes192-cbc
  algorithm: aes128-cbc
  algorithm: twofish-cbc
  algorithm: blowfish-cbc
  algorithm: 3des-cbc
  algorithm: arcfour
MacCS:
  algorithm: hmac-sha1
  algorithm: hmac-sha1-96
  algorithm: hmac-md5
  algorithm: hmac-md5-96
MacSC:
  algorithm: hmac-sha1
  algorithm: hmac-sha1-96
  algorithm: hmac-md5
  algorithm: hmac-md5-96
CompCS:
  algorithm: zlib
  algorithm: none
CompSC:
  algorithm: zlib
  algorithm: none
Encryption: 256-bit AES
Encryption: 256-bit AES
MAC: HMAC-SHA1
MAC: HMAC-SHA1
Compression: none
Compression: none
Key Exchange: DH Group Exchange SHA1
Host Key Algorithm: DSS
numBits: 160
pbits: 2048

Using GEX Group. Sending KEX_DH_GEX_REQUEST... pbits: 2048

Unexpected message received. Expected KEX_DH_GEX_GROUP. msgType: 1 Failed.


I am primarily using the 4 functions to connect to SFTP

sftp.UnlockComponent(ChilkatKey); sftp.Connect(hostname, port); sftp.AuthenticatePw(username, password); sftp.InitializeSftp();

What am I missing ? Thanks for your help.


Answer

You are using an old version of Chilkat (As shown by "DllDate: Dec 22 2010" in the LastErrorText). Updating to the latest version of Chilkat should solve this problem.


Answer

Hi, Thanks for your response; I used the new version; however, I got "similar" error:

ChilkatLog: Connect_SFtp:
DllDate: Aug 15 2013
ChilkatVersion: 9.4.1.42
UnlockPrefix:

XXXXXSSSH
Username: (hidden for security)
Architecture: Little Endian; 32-bit
Language: .NET 2.0

VerboseLogging: 0
SftpVersion: 0
hostname: (hidden for security)
port: 22
ConnectTimeoutMs_1: 50000
calling ConnectSocket2
IPV6 enabled connect with NO heartbeat.
This is an IPV4 numeric

address...
AddrInfoList:
AddrInfo:
ai_flags: 4
ai_family: 2
ai_socktype: 1
ai_protocol: 0
ai_addrlen: 16
ai_canonname: (NULL) --AddrInfo --

AddrInfoList
Connect using IPV4.
ipAddress1: xx.XXX.xxx.XXX
myIP_3: XX.X.XXX.XX
myPort_3: 50483
connect successful (2)
Established TCP/IP connection with SSH server
Turning on

TCP_NODELAY.
clientIdentifier: SSH-2.0-PuTTY_Local:_May_11_2009_17:22:38
Sending client

identifier...
Done sending client identifier.
Reading server version...

initialDataFromSshServer: SSH-2.0-0.0

serverVersion: SSH-2.0-0.0  
KeyExchangeAlgs:

algorithm: diffie-hellman-group1-sha1
algorithm: diffie-hellman-group-exchange-sha1

algorithm: diffie-hellman-group14-sha1
--KeyExchangeAlgs
HostKeyAlgs:
algorithm: ssh-dss

--HostKeyAlgs
EncCS:
algorithm: aes256-cbc
algorithm: aes192-cbc
algorithm: aes128-cbc
algorithm: twofish-cbc
algorithm: blowfish-cbc
algorithm: 3des-cbc
algorithm: arcfour
--EncCS
EncSC:
algorithm: aes256-cbc
algorithm: aes192-cbc
algorithm: aes128-cbc
algorithm: twofish-cbc
algorithm: blowfish-cbc
algorithm: 3des-cbc

algorithm: arcfour
--EncSC
MacCS:
algorithm: hmac-sha1
algorithm: hmac-sha1-96

algorithm: hmac-md5
algorithm: hmac-md5-96
--MacCS
MacSC:
algorithm: hmac-sha1

algorithm: hmac-sha1-96
algorithm: hmac-md5
algorithm: hmac-md5-96
--MacSC
CompCS:

algorithm: zlib algorithm: none --CompCS CompSC:
algorithm: zlib
algorithm: none

--CompSC
Encryption: 256-bit AES CBC
Encryption: 256-bit AES CBC
MAC: HMAC-SHA1
MAC:

HMAC-SHA1
Compression: zlib
Compression: zlib
Key Exchange: DH Group Exchange SHA1
Host Key

Algorithm: DSS
numBits: 160
pbits: 2048
Using GEX Group.
Sending KEX_DH_GEX_REQUEST...

pbits: 2048
Unexpected message received. Expected KEX_DH_GEX_GROUP/KEXDH_REPLY.
msgType: 1

Failed.
--Connect_SFtp
--ChilkatLog


I am primarily using the 4 functions to connect to SFTP

sftp.UnlockComponent(ChilkatKey);
sftp.Connect(hostname, port);
sftp.AuthenticatePw(username, password);
sftp.InitializeSftp();

What am I missing ? Thanks for your help.