yogeetha 0 Newbie Poster

We need to ensure that the connection is secure. The python version we use is 2.6.
Trying to call prot_p() explicitly errors out.
How do we ensure that the connection is secure.

>>> from M2Crypto import ftpslib
>>> ftps = ftpslib.FTP_TLS(host)
>>> ftps.login(username, password)
'230 User logged in.'
>>> ftps.prot_p()


    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python2.6/dist-packages/M2Crypto/ftpslib.py", line 74, in prot_p
            self.voidcmd('PBSZ 0')
      File "/usr/lib/python2.6/ftplib.py", line 248, in voidcmd
        return self.voidresp()
      File "/usr/lib/python2.6/ftplib.py", line 223, in voidresp
        resp = self.getresp()
      File "/usr/lib/python2.6/ftplib.py", line 218, in getresp
        raise error_perm, resp"
    ftplib.error_perm: 503 Command valid only on secure connection.`
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.