GnuTLS error -9: A TLS packet with unexpected length was received.

412 views
Skip to first unread message

mostafa eltejaee

unread,
Apr 5, 2014, 5:08:40 AM4/5/14
to pyft...@googlegroups.com
I have tested TLS_ftpd.py in Ubuntu 12.04 desktop edition and server edition but in both of them I got this error in server and client side :
In server side:
[I 14-04-05 04:08:40] >>> starting FTP server on 127.0.0.1:2121, pid=5532 <<<
[I 14-04-05 04:08:40] poller: <class 'pyftpdlib.ioloop.Epoll'>
[I 14-04-05 04:08:40] masquerade (NAT) address: None
[I 14-04-05 04:08:40] passive ports: None
[I 14-04-05 04:08:40] use sendfile(2): True
[I 14-04-05 04:08:46] 127.0.0.1:57188-[] FTP session opened (connect)
[E 14-04-05 04:08:47] unhandled exception in instance <pyftpdlib.handlers.TLS_FTPHandler object at 0xa611dec>
    Traceback (most recent call last):
      File "/usr/lib/python2.7/asyncore.py", line 83, in read
        obj.handle_read_event()
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/handlers.py", line 2997, in handle_read_event
        super(SSLConnection, self).handle_read_event()
      File "/usr/lib/python2.7/asyncore.py", line 444, in handle_read_event
        self.handle_read()
      File "/usr/lib/python2.7/asynchat.py", line 158, in handle_read
        self.found_terminator()
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/handlers.py", line 1322, in found_terminator
        self.pre_process_command(line, cmd, arg)
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/handlers.py", line 1371, in pre_process_command
        self.process_command(cmd, arg)
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/handlers.py", line 3268, in process_command
        FTPHandler.process_command(self, cmd, *args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/handlers.py", line 1439, in process_command
        method(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/handlers.py", line 2359, in ftp_USER
        self.respond('331 Username ok, send password.')
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/handlers.py", line 1627, in respond
        self.push(resp + '\r\n')
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/handlers.py", line 1622, in push
        asynchat.async_chat.push(self, s.encode('utf8'))
      File "/usr/lib/python2.7/asynchat.py", line 186, in push
        self.initiate_send()
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/ioloop.py", line 885, in initiate_send
        asynchat.async_chat.initiate_send(self)
      File "/usr/lib/python2.7/asynchat.py", line 235, in initiate_send
        num_sent = self.send(data)
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/handlers.py", line 3025, in send
        return super(SSLConnection, self).send(data)
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/ioloop.py", line 854, in send
        return self.socket.send(data)
      File "/usr/local/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 947, in send
        raise TypeError("data must be a byte string")
    TypeError: data must be a byte string
[I 14-04-05 04:08:47] 127.0.0.1:57188-[] FTP session closed (disconnect).

In client side:
Status:    Connecting to 127.0.0.1:2121...
Status:    Connection established, waiting for welcome message...
Response:    220 pyftpdlib 1.3.0 ready.
Command:    AUTH TLS
Response:    234 AUTH TLS successful.
Status:    Initializing TLS...
Status:    Verifying certificate...
Command:    USER user
Status:    TLS/SSL connection established.
Error:    GnuTLS error -9: A TLS packet with unexpected length was received.
Status:    Server did not properly shut down TLS connection
Error:    Could not connect to server

Any body can help me to solve it?

Reply all
Reply to author
Forward
0 new messages