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
Original issue reported on code.google.com by
chen.c...@upai.com
on 12 Nov 2013 at 7:33