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::defaultConfiguration());
request.setSslConfiguration(SslConfiguration);
manager->get(request);
}
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::defaultConfiguration());
request.setSslConfiguration(SslConfiguration);
manager->get(request);
}
To copy to clipboard, switch view to plain text mode
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!
Bookmarks