I'm able to connect to the server, make the SSL handshake, and even change the working directory as well as return it, but trying to upload a file, download a file, or even get a file listing fail with a SocketException. After reading through several posts in this forum concerning this issue, I've tried setting the AutoPassiveIPSubstitution to both TRUE and FALSE. I've tried both PASSIVE and ACTIVE connection modes. Below, I've attached my code (or the method that makes the successful and unsuccessfull EDT.FTP calls) and the resulting log. As a side note, I do receive the MessageBox with the working directory, but I do not receive a MessageBox displaying "not connected". If there's anything else you need, or would like me to try something else out, let me know.
Thanks in advance for your help,
Brad
public void FtpGetFileSecure(string ftpSite, string ftpUser, string ftpPwd, string remoteFile, string localFile, int port)
{
SecureFTPConnection ftp = new SecureFTPConnection();
try
{
Logger.CurrentLevel = EnterpriseDT.Util.Debug.Level.DEBUG;
EnterpriseDT.Util.Debug.FileAppender app = new EnterpriseDT.Util.Debug.FileAppender("log.txt");
EnterpriseDT.Util.Debug.Logger.AddAppender(app);
// Setup connection properties
ftp.ServerAddress = ftpSite;
ftp.ServerPort = port;
ftp.ConnectMode = FTPConnectMode.PASV;
ftp.TransferType = FTPTransferType.BINARY;
ftp.SSLVersion = SSLFTPSSLVersion.SSL3;
ftp.Protocol = FileTransferProtocol.FTPSExplicit;
ftp.ServerValidation = SecureFTPServerValidationType.None;
ftp.Timeout = this.Timeout;
ftp.UserName = ftpUser;
ftp.Password = ftpPwd;
ftp.LicenseOwner = "*********";
ftp.LicenseKey = @"***-****-****-****";
ftp.AutoPassiveIPSubstitution = true;
// Connect to FTPS server
ftp.Connect();
// The UserName is also the home directory
ftp.ChangeWorkingDirectory("/" + ftp.UserName);
MessageBox.Show(ftp.ServerDirectory);
if ( ftp.IsConnected )
{
foreach ( FTPFile file in ftp.GetFileInfos() )
{
this.listBox1.Items.Add(file.Name);
}
}
else { MessageBox.Show("not connected"); }
}
catch ( Exception ex ) { MessageBox.Show(ex.ToString()); }
finally { if ( ftp != null && ftp.IsConnected ) { ftp.Close(false); } }
}
DEBUG [SSLFTPClient] 17 Jan 2007 09:42:36.254 : Connecting to xxx.xxx.com:20021
DEBUG [HostNameResolver] 17 Jan 2007 09:42:36.441 : xxx.xxx.com resolved to xxx.xxx.xxx.xxx
DEBUG [ExFTPControlSocket] 17 Jan 2007 09:42:36.457 : Connecting directly to ftp-server xxx.xxx.xxx.xxx:20021
DEBUG [ExFTPControlSocket] 17 Jan 2007 09:42:36.520 : Created control-socket: SocksContext=, RemoteHost=xxx.xxx.xxx.xxx, controlPort=20021, timeout=0
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:43.553 : 220 <<<CONNECT:Enterprise for UNIX 1.3.02 Secure FTP>>> at eros FTP server ready. Time = 08:42:43
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:43.553 : ---> AUTH SSL
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:43.584 : 234 AUTH TLS-P/SSL OK.
DEBUG [SSLFTPControlSocket] 17 Jan 2007 09:42:43.584 : Beginning Ssl3 handshake.
DEBUG [SSLFTPControlSocket] 17 Jan 2007 09:42:46.929 : Ssl3 handshake complete.
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:46.929 : ---> PBSZ 0
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:46.976 : 200 PBSZ 0 OK.
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:46.976 : ---> PROT P
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.007 : 200 PROT P OK, data channel will be secured.
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.007 : ---> USER uuuuuuuuuu
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.038 : 331 Password required for dgounfnd.
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.038 : ---> PASS **********
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.101 : 230 CONNECT:Enterprise for UNIX login ok, access restrictions apply.
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.101 : ---> TYPE I
DEBUG [EnterpriseDT.Net.Ftp.ExFTPConnection] 17 Jan 2007 09:42:47.116 : Starting KeepAlive thread with period 30s
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.132 : 200 Type set to I.
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.132 : ---> PWD
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.163 : 257 "/uuuuuuuuuu" is current directory.
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.163 : ---> CWD /uuuuuuuuuu
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.210 : 250 CWD command successful.
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.210 : ---> PWD
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.241 : 257 "/uuuuuuuuuu" is current directory.
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.241 : ---> CWD /uuuuuuuuuu
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.273 : 250 CWD command successful.
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.273 : ---> PWD
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.304 : 257 "/uuuuuuuuuu" is current directory.
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.304 : ---> PWD
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:47.335 : 257 "/uuuuuuuuuu" is current directory.
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:51.618 : ---> SYST
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:51.649 : 215 UNKNOWN Type: L8
WARN [FTPFileFactory] 17 Jan 2007 09:42:51.649 : Unknown SYST 'UNKNOWN Type: L8' - defaulting to Unix parsing
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:51.665 : ---> PASV
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:51.696 : 227 Entering Passive Mode (yyy,yyy,yyy,yyy,249,97)
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:51.696 : Server supplied address=yyy.yyy.yyy.yyy
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:51.696 : Server supplied port=63841
DEBUG [FTPControlSocket] 17 Jan 2007 09:42:51.696 : Substituting server supplied IP (yyy.yyy.yyy.yyy) with remote host IP (xxx.xxx.xxx.xxx)
DEBUG [ExFTPControlSocket] 17 Jan 2007 09:42:51.696 : Connecting directly to ftp-server xxx.xxx.xxx.xxx:63841
ERROR [ExFTPControlSocket] 17 Jan 2007 09:43:12.859 : Failed to create connecting socket : System.Net.Sockets.SocketException: 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
System.Net.Sockets.SocketException: 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
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at er.a(EndPoint A_0)
a