This project has moved. For the latest updates, please go here.

Failed to connect to SFTP Server - Bad Data

Jun 10, 2011 at 3:54 PM

Hi !

I'm trying to set up my development environment on my laptop. My Biztalk solution is working fine with our client SFTP Server.

I'm using WinSshD as test server and I'm facing a problem when trying to connect to the server with my Biztalk solution.

I'm using a key authentification (Identifyfile), without passphrase and without password. I've tried different configuration, but I still got the same error :

Event Log :

Method: Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.connect
Error: Unable to connect to Sftp host [localhost]

------------------------------
Information:
Type: System.Exception
Target: 
Message: Unable to connect to Sftp host [localhost]
Stacktrace:

------------------------------
Type: Tamir.SharpSsh.jsch.JSchException
Target: Void connect(Int32)
Message: Session.connect: System.Security.Cryptography.CryptographicException: Bad Data.

   at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
   at System.Security.Cryptography.Utils._ImportKey(SafeProvHandle hCSP, Int32 keyNumber, CspProviderFlags flags, Object cspObject, SafeKeyHandle& hKey)
   at System.Security.Cryptography.DSACryptoServiceProvider.ImportParameters(DSAParameters parameters)
   at Tamir.SharpSsh.jsch.jce.SignatureDSA.verify(Byte[] sig)
   at Tamir.SharpSsh.jsch.DHG1.next(Buffer _buf)
   at Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout)
Stacktrace:
   at Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout)
   at Tamir.SharpSsh.SshBase.ConnectSession(Int32 tcpPort)
   at Tamir.SharpSsh.SshBase.Connect(Int32 tcpPort)
   at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.connect(Boolean force)

WinSSHD Log :

000000000024 2011-06-10 15:12:19.717625 UTC WinSSHD 5.23 [021] Info
  Session thread 1004 handling connection from 127.0.0.1:21938:
  Connection from 127.0.0.1:21938 accepted.

000000000025 2011-06-10 15:12:19.718544 UTC WinSSHD 5.23 [022] Info
  Session thread 1004 handling connection from 127.0.0.1:21938:
  Client version string: SSH-2.0-SharpSSH-1.1.1.13-JSCH-0.1.28

000000000026 2011-06-10 15:12:19.718556 UTC WinSSHD 5.23 [152] Trace
  Session thread 1004 handling connection from 127.0.0.1:21938:
  Starting first key exchange.

000000000027 2011-06-10 15:12:19.819197 UTC WinSSHD 5.23 [152] Trace
  Session thread 1004 handling connection from 127.0.0.1:21938:
  First out key exchange done.

000000000028 2011-06-10 15:12:19.838988 UTC WinSSHD 5.23 [093] Info
  Session thread 1004 handling connection from 127.0.0.1:21938:
  Client disconnected the session with SshDisconnect.KeyExchangeFailed
  Description: System.Security.Cryptography.CryptographicException: Bad Data.
  
     at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
     at System.Security.Cryptography.Utils._ImportKey(SafeProvHandle hCSP, Int32 keyNumber,
  CspProviderFlags flags, Object cspObject, SafeKeyHandle& hKey)
     at System.Security.Cryptography.DSACryptoServiceProvider.ImportParameters(DSAParameters parameters)
     at Tamir.SharpSsh.jsch.jce.SignatureDSA.verify(Byte[] sig)
     at Tamir.SharpSsh.jsch.DHG1.next(Buffer _buf)
     at Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout)