PDA

View Full Version : Explicit FTP over SSL/TLS (FTPES) wiht QNetworkAccessManager



ashe
22nd December 2010, 11:25
Hello there,
im trying to download a file from a FTP server, which allows only secure connections. I already compiled Qt 4.6.3 with -openssl. Thats the code im using right now:



void Ftp::get()
{
QNetworkAccessManager* manager = new QNetworkAccessManager()

QUrl url = QUrl("ftp://localhost/test.txt");
url.setUserName("root");
url.setPassword("root");
url.setPort(21);

QNetworkRequest request(url);

QSslConfiguration SslConfiguration(QSslConfiguration::defaultConfigu ration());

request.setSslConfiguration(SslConfiguration);

manager->get(request);
}


The ftp server answers:


(000022)22.12.2010 11:18:36 - (not logged in) (127.0.0.1)> USER root
(000022)22.12.2010 11:18:36 - (not logged in) (127.0.0.1)> 530 Have to use explicit SSL/TLS before logging on.

Am I doing wrong or is FTPS/FTPES not possible? I tried to connect to "ftps://" or "ftpes://" instead of "ftp://" but that creates the error string
"Protocol "ftps" is unknown" .

Thank you all!

emobemo
25th June 2014, 11:45
Four years later and it seems that SSL support for FTP is still not implemented in QNetworkAccessManager.