|
How to use FTPS (without server validation)
|
|
The topic How to use FTPS (introduction) describes the FTPS features of SecureFTPConnection. This topic demonstrates the use of FTPS without server validation.
Server validation should always be used in a production environment, but disabling it is a good
way of getting started.
IMPORTANT: An FTPS compatible FTP server is required for this example. There are free
FTPS-compatible servers available on Windows and *NIX platforms.
Using FTPS without server validation is simply a matter of setting the Protocol and ServerValidation properties as follows:
ftpConnection.Protocol = FileTransferProtocol.FTPSExplicit;
ftpConnection.ServerValidation = SecureFTPServerValidationType.None
The first line tells SecureFTPConnection that
it is to use explicit FTPS and the second line that
it should not try to validate the server's certificate.
After this a secure connection is established by simply calling Connect():
ftpConnection.Connect();