I want to connect to an external server using explicit FTP over TLS using http proxy (with authentification)
I want to use a python function (3.6)
I test the connexion with FileZilla and it works.
I found that we can use the FTP_TLS function (https://docs.python.org/3/library/ftplib.html#ftp-tls-objects). I'am not able to set this function correctly.
The code I'am testing:
from ftplib import \*
\-- host settings
ftpusername = 'FtpUserName'
ftppassword = 'ftpPassWord'
ftp_host = 'xxxx.yyyy.fr'
\-- proxy settings
host_proxy = 'http.xxxxx.xxxxx.com'
(I test it also with the ip adress of the proxy: 1a2.21.aa.aa)
user_proxy = 'userNameProxy'
pass_proxy = 'passProxy'
u = "%s@%s %s" % (ftpusername , ftp_host, ftppassword)
ftp = FTP_TLS()
ftp.connect(host_proxy, 80)
ftp.login(u, user_pass, pass_proxy)
ftp.close()
ftp.quit()
The error I got: