views:

62

answers:

2

As the title states, I can connect to another machine from my server via FileZilla Client, but I cannot via code (.Net - FTPWebRequest)

I know the code is good, as it works from another machine. The particular machine I am having trouble with is behind a NAT, but the SA has opened all ports for traffic from the host we are trying to talk to.

Any suggestions - have I missed something obvious?

The exception I get from the attempted connection is:

"Unable to read data from the transport connection: 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."

And, the logs from the machine we are trying to connect show:

7/26/2010 12:40:23 PM - (not logged in) (xx.xx.xxx.xxx)> Connected, sending welcome message...

7/26/2010 12:40:23 PM - (not logged in) (xx.xx.xxx.xxx)> 220-FileZilla Server version 0.9.32 beta

7/26/2010 12:40:23 PM - (not logged in) (xx.xx.xxx.xxx)> 220 ftp.xxxxxxxxxx.com

7/26/2010 12:40:23 PM - (not logged in) (xx.xx.xxx.xxx)> AUTH TLS

7/26/2010 12:40:24 PM - (not logged in) (xx.xx.xxx.xxx)> 234 Using authentication type TLS

7/26/2010 12:41:24 PM - (not logged in) (xx.xx.xxx.xxx)> 421 Login time exceeded. Closing control connection.

7/26/2010 12:41:24 PM - (not logged in) (xx.xx.xxx.xxx)> disconnected.

A: 

Maybe, there is a problem in certificate, which server sends during TLS/SSL negotiation, i.e. it is not accepted by operating system, or so on. Try to run Wireshark to check, which data is actually sent between client and server.

Nickolay O.
+1  A: 

Sorry I forgot to come back here with my solution - It was implicit vs explicit SSL. I was using implicit for the FileZilla use case but explicit for the FTPWebRequest. Unfortunately, FTPWebRequest doesn't support implicit and the NAT was having problems with explicit.

Long story short, we went with a FTPS control called Alex FTPS client that is easy to use for either implicit or explicit ssl, easy to setup, and works flawlessly.

IniTech
+1 for Alex FTPS. However, be careful with self-signed certs and implicit SSL connections. I had to modify the source of the 1.0.2 version to get it to work per this link (http://ftps.codeplex.com/Thread/View.aspx?ThreadId=63605). However, once I did that it works flawlessly.
mattmc3