psychoone7 / pyftpdlib

Automatically exported from code.google.com/p/pyftpdlib
Other
0 stars 0 forks source link

pyftpdlib 1.2.0 TLS_FTPHandler ThrottledDTPHandler #274

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Recently i need to add tls over our company's ftp,however, can't make it 
anyway,then i try the demo's code,set ThrottledDTPHandler to dtp_handler in 
demo's tls_ftpd.py,not working out.is it impossible put those two handler 
together?

ftp client is filezilla, pyftpdlib and openssl are new.

import os

from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import TLS_FTPHandler
from pyftpdlib.handlers import import os

from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import TLS_FTPHandler
from pyftpdlib.handlers import ThrottledDTPHandler   
from pyftpdlib.servers import FTPServer

CERTFILE = os.path.abspath(os.path.join(os.path.dirname(__file__),
                                        "keycert.pem"))

def main():
    authorizer = DummyAuthorizer()
    authorizer.add_user('user', '12345', '.', perm='elradfmw')
    authorizer.add_anonymous('.')
    handler = TLS_FTPHandler
    handler.dtp_handler = ThrottledDTPHandler
    handler.certfile = CERTFILE
    handler.authorizer = authorizer
    handler.tls_control_required = True
   # handler.dtp_handler = DTPHandler
    # requires SSL for both control and data channel
    #handler.tls_control_required = True
   # handler.tls_data_required = False
    server = FTPServer(('127.0.0.1', 2121), handler)
    server.serve_forever()
    print handler.dtp_handler
if __name__ == '__main__':
    main()   
from pyftpdlib.servers import FTPServer

CERTFILE = os.path.abspath(os.path.join(os.path.dirname(__file__),
                                        "keycert.pem"))

def main():
    authorizer = DummyAuthorizer()
    authorizer.add_user('user', '12345', '.', perm='elradfmw')
    authorizer.add_anonymous('.')
    handler = TLS_FTPHandler
    handler.dtp_handler = ThrottledDTPHandler
    handler.certfile = CERTFILE
    handler.authorizer = authorizer
    handler.tls_control_required = True
   # handler.dtp_handler = DTPHandler
    # requires SSL for both control and data channel
    #handler.tls_control_required = True
   # handler.tls_data_required = False
    server = FTPServer(('127.0.0.1', 2121), handler)
    server.serve_forever()
if __name__ == '__main__':
    main()

Original issue reported on code.google.com by chen.c...@upai.com on 12 Nov 2013 at 7:33

GoogleCodeExporter commented 9 years ago
Can you post this on the mailing list?
https://groups.google.com/forum/#!forum/pyftpdlib

Original comment by g.rodola on 12 Nov 2013 at 8:30

GoogleCodeExporter commented 9 years ago

Original comment by g.rodola on 11 Apr 2014 at 9:32