Error connecting for client (wodVPN)
I love this tool, and it works great but once i installed my app at the clients site, it will not connect. i get the error that 'System.Net.Sockets.SocketException'. The client is on a VPN ( and everything is blocked out) so i asked the admin to open up port 22. Are there any other ports that I need to download a file from the SFTP server?? I am logging the proxy type and it returns none so i dont thing i have a proxy problem. i am also logging the port and i believe the sftp tool is using port 22 alone. i can go to the client command prompt and type in 'Telnet xxx.xxx.xxx.xxx 22' and it says i have established a connection but the sftp tool will not connect to the server???? here is a snippet of my code:
sftp.Hostname = ip
sftp.Login = user
sftp.Password = pass
sftp.Blocking = True
sftp.Port = 22
Logit.ftpLog( Connecting to server & ip)
Logit.ftpLog( Checking Port. )
Logit.ftpLog( using port & sftp.Port.ToString())
If sftp.ProxyType = WeOnlyDo.Client.SFTP.ProxyTypes.ProxyNone Then
Logit.ftpLog( Proxy type is set to sftp.proxyType.Proxynone )
ElseIf sftp.ProxyType = WeOnlyDo.Client.SFTP.ProxyTypes.ProxyRelay Then
Logit.ftpLog( Proxy type is set to sftp.proxytype.ProxyRelay )
ElseIf sftp.ProxyType = WeOnlyDo.Client.SFTP.ProxyTypes.ProxySocks4 Then
Logit.ftpLog( Proxy type is set to sftp.proxyType.ProxySocks4 )
ElseIf sftp.ProxyType = WeOnlyDo.Client.SFTP.ProxyTypes.ProxySocks4a Then
Logit.ftpLog( Proxy type is set to sftp.proxyType.ProxySocks4a )
ElseIf sftp.ProxyType = WeOnlyDo.Client.SFTP.ProxyTypes.ProxySocks5 Then
Logit.ftpLog( Proxy type is set to sftp.proxyType.ProxySocks5 )
ElseIf sftp.ProxyType = WeOnlyDo.Client.SFTP.ProxyTypes.ProxySocks5 Then
Logit.ftpLog( Proxy type is set to sftp.proxyType.ProxySocks5 )
ElseIf sftp.ProxyType = WeOnlyDo.Client.SFTP.ProxyTypes.ProxyWEBStandard Then
Logit.ftpLog( Proxy type is set to sftp.proxyTyep.ProxyWebStandars )
Else
Logit.ftpLog( Proxy type could not be detected. )
End If
sftp.Connect()
Logit.ftpLog(ip & connected successfully )
The code never reaches the last log where it is connected. I can see everything in the log file up until I issue the connect command. any ideas on what I need to tell this admin so my software will work??
Here is what my log file looks like:
11/9/2005 10:22:37 AM : Connecting to server xxx.xxx.xxx.xx
11/9/2005 10:22:37 AM : using port 22
11/9/2005 10:22:37 AM : Proxy type is set to sftp.proxyType.Proxynone
Thanks in advance,
Mike
Re: Error connecting for client
Mike,
code looks ok to me, I have no ideas why it wouldn't work. SFTP uses only port 22, so this is ok too.
Do you run this as a windows service perhaps? Maybe your local windows firewall prevents you from going out?
Kreso
Re: Error connecting for client
I agree, the code looks harmless to me as well. considering I am getting a socket error, do you have any tips on debugging better than i have done??
I am not running the app as a service and I tested everything out before the gear was installed at the site and i checked out perfectly. Once under the VPN, no connection and then a socket error occurs. If i can hit the SFTP through telnet command, what would cause the tool to not connect?? any ideas?
Thanks,
mike
Re: Error connecting for client
Mike,
I forgot to ask. You get SocketException. What message does it give you?
Re: Error connecting for client
I added some more debugging, but all it tells me is that there was no response to the socket:
11/9/2005 12:48:41 PM : Connecting to server xxx.xxx.xxx.xx
11/9/2005 12:48:41 PM : Checking Port.
11/9/2005 12:48:41 PM : using port 22
11/9/2005 12:48:41 PM : Proxy type is set to sftp.proxyType.Proxynone
11/9/2005 12:48:41 PM : Timeout is set to 29000
11/9/2005 12:49:11 PM : Error while trying to connect to host.
11/9/2005 12:49:14 PM : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
I tried to add a timeout so i can generate the message faster. This is what I am getting. Is there any resource that I can use (sftp freeware) to prove to this guy that something is wrong on his end?
I am sure it is not the code or the utility but I am in a position where I have to prove that to this guy or he is just going to keep throwing the ball back into my court.
Thanks for the fast resonse as well, u guys are awesome!!
Mike
Re: Error connecting for client
No response? Then this sounds like silent firewall issue.
You can download PSFTP.EXE from putty's download page. If you search on google for 'putty download' you'll get that page as first hit.
Re: Error connecting for client
Now I am really confused. I downloaded the utiltity psftp.exe like you suggested and it works like a champ through the VPN????? I also downloaded putty and it worked just fine too???? Now I know I am doing something incorrect, but I just dont know what it is. I could not find a way to turn on logging with psftp but I did get putty to output a log file and it really does not show any of the connection protocol information, so I dont have an example to tell me what piece I am missing... both of these pieces of software have quite a few settings so I am going to look further into them to see how it is that they can connect and I cant. Any ideas are welcome though.
Mike
Re: Error connecting for client
Mike,
you do have access to that system, right? Can you take our sample application and run it there? Does that work?
Re: Error connecting for client
I hate to ask, but would it be possible for me to try? If you can give me access, please send details to techsupport@weonlydo.com
Re: Error connecting for client
I tried running the sample application too and it crashes with a socket error as well. i guess i need to add some debugging to it and recompile it to see what the error is further. At first I thought I was getting out of the VPN but the response was getting blocked but after i tried psftp and it ran smoothly, that theory was blown out of the water.