Hi,
when trying to connect to an ssl ftp for some reason the library does not send USER / PASS. The samples are pretty self explanatory so I'm not too sure what I'm doing wrong. Here is the code I'm using:
SecureFTPConnection newConn = new SecureFTPConnection();
newConn.AutoLogin = true;
newConn.ServerAddress = "127.0.0.1";
newConn.ServerPort = 5001;
newConn.UserName = "username";
newConn.Password = "password";
//newConn.SSLVersion = SSLFTPSSLVersion.TLS1;
newConn.Protocol = FileTransferProtocol.FTPSExplicit;
newConn.ServerValidation = SecureFTPServerValidationType.None;
newConn.Connect();
Here is what's happening by catching the corresponding events:
<- 220 ZDNET mirror v3.1
-> ---> AUTH TLS
<- 234 AUTH TLS successful
-> ---> PBSZ 0
<- 200 Command okay
-> ---> PROT P
<- 530 Not logged in.
-> ---> QUIT
<- 221 Goodbye!
And here is a more detailed log:
INFO [LicenseProperties] 31 May 2007 00:34:31.554 : Licence expiry date: 7/14/2007
INFO [LicenseProperties] 31 May 2007 00:34:31.554 : Trial license
INFO [LicenseProperties] 31 May 2007 00:34:31.560 : Licence expiry date: 7/14/2007
INFO [LicenseProperties] 31 May 2007 00:34:31.560 : Trial license
DEBUG [SSLFTPClient] 31 May 2007 00:34:31.561 : Connecting to 127.0.0.1:5001
DEBUG [HostNameResolver] 31 May 2007 00:34:31.590 : 127.0.0.1 resolved to 127.0.0.1
DEBUG [SSLFTPControlSocket] 31 May 2007 00:34:31.592 : waitOnShutdownSSL=True
DEBUG [ExFTPControlSocket] 31 May 2007 00:34:31.606 : Connecting directly to ftp-server 127.0.0.1:5001
DEBUG [ExFTPControlSocket] 31 May 2007 00:34:31.615 : Created control-socket: SocksContext=, ProxySettings=EnterpriseDT.Net.Proxy.ProxySettings, RemoteHost=127.0.0.1, controlPort=5001, timeout=120000
DEBUG [FTPControlSocket] 31 May 2007 00:34:32.145 : 220 ZDNET mirror v3.1
DEBUG [FTPControlSocket] 31 May 2007 00:34:32.157 : ---> AUTH TLS
DEBUG [FTPControlSocket] 31 May 2007 00:34:32.531 : 234 AUTH TLS successful
DEBUG [SSLFTPControlSocket] 31 May 2007 00:34:32.533 : Beginning Tls1 handshake.
DEBUG [SocketController] 31 May 2007 00:34:33.016 : Processing hello
DEBUG [SSLFTPControlSocket] 31 May 2007 00:34:34.109 : Tls1 handshake complete.
DEBUG [FTPControlSocket] 31 May 2007 00:34:34.110 : ---> PBSZ 0
ALL [AsyncResult] 31 May 2007 00:34:34.115 : Notify setting completed: null 0
ALL [AsyncResult] 31 May 2007 00:34:34.116 : Notify setting wait: 0
ALL [TransferBuffer] 31 May 2007 00:34:34.490 : Wait begin: TransferBuffer.Read
ALL [TransferBuffer] 31 May 2007 00:34:34.490 : Wait end: TransferBuffer.Read
DEBUG [FTPControlSocket] 31 May 2007 00:34:34.490 : 200 Command okay
DEBUG [FTPControlSocket] 31 May 2007 00:34:34.491 : ---> PROT P
ALL [AsyncResult] 31 May 2007 00:34:34.491 : Notify setting completed: null 2
ALL [AsyncResult] 31 May 2007 00:34:34.491 : Notify setting wait: 2
ALL [TransferBuffer] 31 May 2007 00:34:34.864 : Wait begin: TransferBuffer.Read
ALL [TransferBuffer] 31 May 2007 00:34:34.864 : Wait end: TransferBuffer.Read
DEBUG [FTPControlSocket] 31 May 2007 00:34:34.864 : 530 Not logged in.
INFO [FTPControlSocket] 31 May 2007 00:34:34.864 : Expected reply codes = [200]
DEBUG [AsyncProcessor] 31 May 2007 00:34:34.875 : Stopping FTP task processor.
DEBUG [AsyncProcessor] 31 May 2007 00:34:34.875 : FTP task processor stopped.
DEBUG [FTPControlSocket] 31 May 2007 00:34:34.878 : ---> QUIT
ALL [AsyncResult] 31 May 2007 00:34:34.879 : Notify setting completed: null 4
ALL [AsyncResult] 31 May 2007 00:34:34.879 : Notify setting wait: 4
DEBUG [SocketController] 31 May 2007 00:34:35.254 : Status=ShutdownSSL
ALL [TransferBuffer] 31 May 2007 00:34:35.254 : Wait begin: TransferBuffer.Read
ALL [TransferBuffer] 31 May 2007 00:34:35.254 : Wait end: TransferBuffer.Read
ALL [TransferBuffer] 31 May 2007 00:34:35.254 : Wait end: TransferBuffer.Read
DEBUG [SocketController] 31 May 2007 00:34:35.254 : OnReceive closing (size == 0)
DEBUG [FTPControlSocket] 31 May 2007 00:34:35.254 : 221 Goodbye!
DEBUG [SocketController] 31 May 2007 00:34:35.256 : CloseConnection(e=null)
DEBUG [TransferBuffer] 31 May 2007 00:34:35.260 : Close() called when open
DEBUG [SocketController] 31 May 2007 00:34:35.271 : Dispose()
DEBUG [SocketController] 31 May 2007 00:34:35.271 : CloseConnection(e=null)
If I remove "newConn.Protocol = FileTransferProtocol.FTPSExplicit;" the login sequence appears to be the correct one, of course the connection is no longer secure.
I'm using .net 2.0.
Thanks,
Paul
________
Motorcycle tires