Establishing a secure connection

Top  Previous  Next

To establish a secure connection to an FTP server set the ConnectionType property and invoke the Connect method.  There are two types of secure FTP connections, explicit SSL and implicit SSL.  Implicit SSL runs on a separate SSL secured port than standard FTP, whereas explicit SSL runs on the same port as standard FTP, switching to secure FTP using either the AUTH SSL or AUTH TLS commands.

 

Note

 

Consult your FTP server documentation to see which mode(s) your FTP server supports. Not all FTP servers support secure FTP connections using SSL. Of those that do support SSL some may only support one of the methods AUTH TLS, AUTH SSL or Implicit SSL.          

 

 

Example

 

This example creates a secure connection using the IMPLICIT_SSL connection type.

 

[C#]

// create new Ftp instance and secure connection

Ftp myFtp = new Ftp(hostname, username, password);

myFtp.ConnectionType = Ftp.IMPLICIT_SSL;

myFtp.Port = 990;

myFtp.Connect();

 

 

[Visual Basic]

Public WithEvents myFtp As Jscape.Ftp.Ftp

myFtp = New Ftp(hostname, username, password)

myFtp.ConnectionType = Jscape.Ftp.Ftp.IMPLICIT_SSL

myFtp.Port = 990

myFtp.Connect()

 

 

Example

 

This example creates a secure connection using the AUTH_TLS connection type.

 

[C#]

// create new Ftp instance and secure connection

Ftp myFtp = new Ftp(hostname, username, password);

myFtp.ConnectionType = Ftp.AUTH_TLS;

myFtp.Connect();

 

 

[Visual Basic]

Public WithEvents myFtp As Jscape.Ftp.Ftp

myFtp = New Ftp(hostname, username, password)

myFtp.ConnectionType = Jscape.Ftp.Ftp.AUTH_TLS

myFtp.Connect()

 

 

See also

 

Establishing a connection