View Single Post
Old 03-05-2012, 01:57 PM
tomfromokaloosa tomfromokaloosa is offline
Registered User
Join Date: Mar 2012
Posts: 2
Failing on VRALib Connect() from C# in a Windows Service

Thank you for your help.

I've also used the following code, except that the address, username, and password have been changed here. The results follow the code, with the actual IP address removed from the log.
conn.DebugLevel = 99;
conn.DebugLogFile = @"D:\logs\SFTPvralib.txt";
conn.Hostname = ""; //actual address instead of this
conn.Port = 22;
conn.Username = "tom"; //actual user instead of this
conn.Password = "betterPassword"; //actual password instead of this

Log Results:
3/5/2012 8:18:51 PM,7308,1,[LOCAL] : SSH2Core version (init timing: 172 milliseconds)
3/5/2012 8:18:51 PM,7308,1,[LOCAL] : Connecting to MY_IP_ADDRESS ...
012 8:18:51 PM,7308,1,[LOCAL] : Changing state from STATE_NOT_CONNECTED to STATE_EXPECT_KEX_INIT
3/5/2012 8:18:51 PM,7308,1,[LOCAL] : RECV: TCP/IP close
3/5/2012 8:18:51 PM,7308,1,[LOCAL] : RECV: OnRead(dwStatus=0x00000000)
3/5/2012 8:18:51 PM,7308,1,[LOCAL] : RECV: CloseTransport(rmp=0x00000000)
3/5/2012 8:18:51 PM,7308,1,[LOCAL] : Changing state from STATE_EXPECT_KEX_INIT to STATE_CLOSED
3/5/2012 8:18:51 PM,7308,1,[LOCAL] : Connected for 0 seconds, 0 bytes sent, 0 bytes received
3/5/2012 8:18:51 PM,7308,1,[LOCAL] : RECV: OnWrite(dwStatus=0x00002746)
3/5/2012 8:18:51 PM,7308,1,[LOCAL] : RECV: CloseTransport(rmp=0xe104000a)

I copied, pasted, and edited the connection object properties from the sfxcl.exe command line parameter that's actually used, so I'm sure that I am using the right credentials. I'm guessing that the response I'm getting is from a firewall in between. Is it possible that sfxcl.exe somehow leverages my certificate store on my server to authenticate to firewalls/proxy servers in between, but the .NET class does not? Is there something else I could be overlooking here?

Note that both the service that has this code in it and sfxcl.exe have been configured to use local machine credentials to keep things as close to identical configuration as possible.

This code gets a clean compile, I've installed the VanDyke Client Pack using the installer, and I'm building my application as a .NET 4.0 windows service.

Reply With Quote