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

Skip to first unread message

mostafa eltejaee

Apr 5, 2014, 5:08:40 AM4/5/14
I have tested 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, 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][] 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/", line 83, in read
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/", line 2997, in handle_read_event
        super(SSLConnection, self).handle_read_event()
      File "/usr/lib/python2.7/", line 444, in handle_read_event
      File "/usr/lib/python2.7/", line 158, in handle_read
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/", line 1322, in found_terminator
        self.pre_process_command(line, cmd, arg)
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/", line 1371, in pre_process_command
        self.process_command(cmd, arg)
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/", line 3268, in process_command
        FTPHandler.process_command(self, cmd, *args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/", line 1439, in process_command
        method(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/", line 2359, in ftp_USER
        self.respond('331 Username ok, send password.')
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/", line 1627, in respond
        self.push(resp + '\r\n')
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/", line 1622, in push
        asynchat.async_chat.push(self, s.encode('utf8'))
      File "/usr/lib/python2.7/", line 186, in push
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/", line 885, in initiate_send
      File "/usr/lib/python2.7/", line 235, in initiate_send
        num_sent = self.send(data)
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/", line 3025, in send
        return super(SSLConnection, self).send(data)
      File "/usr/local/lib/python2.7/dist-packages/pyftpdlib/", line 854, in send
        return self.socket.send(data)
      File "/usr/local/lib/python2.7/dist-packages/OpenSSL/", 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][] FTP session closed (disconnect).

In client side:
Status:    Connecting to
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
0 new messages