Closed zussel closed 3 months ago
I always use FTPS (explicit) connection without problem in my code since years. You have to use Poco::Net::FTPSClientSession
For example
bool bReadWelcomeMessage = true;
bool bTryUseFTPS = true;
Poco::Net::Context::Ptr pContext = Poco::Net::SSLManager::instance().defaultClientContext();
Poco::Net::StreamSocket ftpSocket;
Poco::Net::SocketAddress sa(sHost, iPort);
ftpSocket.connect(sa, spanConnectionTimeout);
ftpSocket.setReuseAddress(true);
ftpSocket.setNoDelay(true);
Poco::Net::FTPSClientSession cFtp(ftpSocket, bReadWelcomeMessage, bTryUseFTPS, pContext);
I've tried to establish a FTP connection (implicit and explicit, with valid and invalid certificate) to a vsftpd server within a docker container (based on this container: https://hub.docker.com/r/loicmathieu/vsftpd) with POCO
FTP(S)ClientSession
.See my code example for an implicit FTP connection expecting a self signed certificate below:
I always receive an error as soon as a data channel is about to becreated:
NLST command failed: 522 Data connections must be encrypted.
In the example the line whereFTPCLientSession::beginList()
is called.I'm using:
Thanks for your support.