This project is read-only.

Connect Timeout when I am trying to connect to a Debian proftpd-server

Mar 28, 2013 at 1:23 PM
The Subject says it all. I am trying to connect to a debian proftpd-server that I installed myself with my program. FileZilla can establish the connection (explicit FTPS). I also use Explicit on and the same user in my program. Connection to a local server works.
Coordinator
Mar 28, 2013 at 1:54 PM
Connection timeout where? The initial connection? A data channel? You're not giving me any information, you're just telling me you have a problem which I can't help because I have no idea what you've done or how to reproduce the problem. I have used System.Net.FtpClient with ProFTPD so I'm fairly certain the issue isn't there. Show some code, show me which line is bombing so that I can determine if it's the control connection that's having problems or a data connection that's having problems. And as usual, if there is any debugging output from System.Net.FtpClient available please provide that too.
Mar 28, 2013 at 3:15 PM
I think i misconfigured something in ProFTPD. In my program line it crashes at ftpclient.connect(). I call the method right at the beginning at a button click:
        Dim ftpclient As New FtpClient
        AddHandler ftpclient.ValidateCertificate, AddressOf SSLcertificateHandler
        ftpclient.Host = sFtpHost
        ftpclient.Port = iFtpPort
        ftpclient.Credentials = credentials
        ftpclient.EncryptionMode = ftpencryptmode
        ftpclient.Connect()
http://s14.directupload.net/images/130328/i9hec8gx.png
Image

http://s1.directupload.net/images/130328/9eykivtv.png
Image

How can I include the ftpclient.sln to the debugging process? I had it, but deactivated it since it slowed down the debugging of my own code. I can then provide you with more information, where it exactly crashes.
Coordinator
Mar 28, 2013 at 3:22 PM
If you have System.Net.FtpClient in your solution, go to the project properties and the Build tab. There should be a field called Conditional Complication Symbols. Add DEBUG to it and rebuild the entire solution.

What are the exact settings you're using in filezilla? Port number and encryption settings. I think FileZilla has an option to log the transaction which would be helpful.
Mar 28, 2013 at 10:51 PM
I'll provide you with the information when I am back in our office next week. Now I have another Problem. Why do i get an FTPCommandException: invalid filename with this path:
"BuildYourCloud/NVIDIA Corporation/3D Vision Experience/3D Vision preview pack 1/burnout paradise - 2 - esrb e pegi 7+.jps"
this is where the StreamOutput is going. Is the problem the spaces in the filename? or the + ?
Coordinator
Mar 28, 2013 at 11:05 PM
FTP Command Exceptions are generated by the server, I.E., your server said that file name was invalid, not System.Net.FtpClient.
Apr 2, 2013 at 9:56 AM
I fixed the problem with the proftpd server. Now I can connect to the server. I also resolved the invalid filename problem.

Now i have another strange problem. The code of my program is exactly the same on botch machines.

Machine 1:
Win7 Notebook, Visual Studio 2012 Pro, network at work

Machine2:
Win8 Desktop, Visual Studio 2012 Ultimate, home network

FTP1:
localhost (FileZilla Server), same config on both machines

FTP2:
AVM Fritz!Box 3370 Router/Modem FTP-Server (home network)

FTP3:
ProFTPd on Debian 6.0.6 (at work)

Situation Machine1:
The FTP connection hangs on AUTH TLS (after ftpclient.connect) for multiple seconds (~30s) and on LIST (FTP2) or MLSD (FTP1 and FTP3), then rushes through the other commands until the next list/mlsd/auth tls.
I faced this problem the first time about a week ago. I usually code on machine1 and the connection has never been so slow before.

Situation Machine2:
Everything runs fine and as fast as possible.
Coordinator
Apr 2, 2013 at 2:09 PM
When you call a method that uses a data channel (GetListing(), OpenRead(), OpenWrite(), OpenAppend()) a new control connection is established for thread safety. That's why you see the hang again when doing a listing. This can be turned off (EnableThreadSafeDataConnections = false). I don't know why negotiating encryption on your workstation at work would take so long. Sounds like a problem with the machine or some kind of device on the network doing SPI might be causing it. Not really sure what I can do to help debug. Only information I can offer is that this project uses SslStream for encryption which is part of the .net framework.
Coordinator
Apr 2, 2013 at 2:17 PM
I found this article which is interesting and probably related to the delay that you're seeing.
Apr 2, 2013 at 2:53 PM
Wow , disabling the Root Certificate Updating did the trick. I never thought of that. Now I can finally carry on with my code. Thank you very much!