Exemplo n.º 1
0
 def __init__(self, conn, server):
     FTPHandler.__init__(self, conn, server)
     if not self.connected:
         return
     self._extra_feats = ['AUTH TLS', 'AUTH SSL', 'PBSZ', 'PROT']
     self._pbsz = False
     self._prot = False
     self.ssl_context = self.get_ssl_context()
Exemplo n.º 2
0
 def __init__(self, conn, server):
     FTPHandler.__init__(self, conn, server)
     if not self.connected:
         return
     self._extra_feats = ['AUTH TLS', 'AUTH SSL', 'PBSZ', 'PROT']
     self._pbsz = False
     self._prot = False
     self.ssl_context = self.get_ssl_context()
Exemplo n.º 3
0
 def process_command(self, cmd, *args, **kwargs):
     if cmd in ('USER', 'PASS'):
         if self.tls_control_required and not self._ssl_established:
             msg = "SSL/TLS required on the control channel."
             self.respond("550 " + msg)
             self.log_cmd(cmd, args[0], 550, msg)
             return
     elif cmd in ('PASV', 'EPSV', 'PORT', 'EPRT'):
         if self.tls_data_required and not self._prot:
             msg = "SSL/TLS required on the data channel."
             self.respond("550 " + msg)
             self.log_cmd(cmd, args[0], 550, msg)
             return
     FTPHandler.process_command(self, cmd, *args, **kwargs)
 def process_command(self, cmd, *args, **kwargs):
     if cmd in ('USER', 'PASS'):
         if self.tls_control_required and not self._ssl_established:
             msg = "SSL/TLS required on the control channel."
             self.respond("550 " + msg)
             self.log_cmd(cmd, args[0], 550, msg)
             return
     elif cmd in ('PASV', 'EPSV', 'PORT', 'EPRT'):
         if self.tls_data_required and not self._prot:
             msg = "SSL/TLS required on the data channel."
             self.respond("550 " + msg)
             self.log_cmd(cmd, args[0], 550, msg)
             return
     FTPHandler.process_command(self, cmd, *args, **kwargs)
Exemplo n.º 5
0
 def flush_account(self):
     FTPHandler.flush_account(self)
     self._pbsz = False
     self._prot = False
 def flush_account(self):
     FTPHandler.flush_account(self)
     self._pbsz = False
     self._prot = False
Exemplo n.º 7
0
 def __init__(self, conn, server):
     FTPHandler.__init__(self, conn, server)
     if not self.connected:
         return