[Twisted-Python] FTP client with TLS

Jp Calderone exarkun at intarweb.us
Fri Jun 6 13:04:44 EDT 2003

On Fri, Jun 06, 2003 at 12:01:26PM +0200, Robert Penz wrote:
> Hi!
> I'm starting writting a ftp client script to a server which accepts only TLS 
> connects. I'm currently deciding with framework/library I use. I had a look 
> at m2crypto and twisted. 
> At m2crypto I know it works, as there is an example which was able to login 
> and it got a directory listing, but I would like also test twisted as it 
> seems to go much further in many parts.
> So my question is: Is FTP via TLS possible and can someone direct me to an 
> example. Thx. 

  If FTP TLS is anything like TLS in SMTP or IMAP or POP, the client issues
a command like "starttls" then issues no further commands until the server
acknowledges this, at which point some level of encryption is negotiated and
the remainder of the session is so encrypted.

  In this case, adding support for TLS to Twisted's FTP should be very
straightforward.  All that is required is a call to the transport object's
startTLS() method at the appropriate time.  There may be complications due
to the additional connections FTP creates, but this is the basic gist of

  Just to clarify (I can't tell if you're aware or not), Twisted uses
PyOpenSSL for TLS, not m2crypto.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20030606/ae09c271/attachment.pgp 

More information about the Twisted-Python mailing list