Poco::Net

class FTPSClientSession

Library: NetSSL_OpenSSL
Package: FTPS
Header: Poco/Net/FTPSClientSession.h

Description

This is an extension of FTPClientSession that supports FTP over SSL/TLS using the AUTH SSL/AUTH TLS and PBSZ/PROT commands according to RFC 4217.

Inheritance

Direct Base Classes: FTPClientSession

All Base Classes: FTPClientSession

Member Summary

Member Functions: allowPlaintextFallback, enableFTPS, establishDataConnection, forceSessionReuse, isPlaintextFallbackAllowed, isSecure, receiveServerReadyReply

Inherited Functions: abort, activeDataConnection, beginDownload, beginList, beginUpload, cdup, close, createDirectory, endDownload, endList, endTransfer, endUpload, establishDataConnection, extractPath, getFileType, getHost, getPassive, getTimeout, getWorkingDirectory, isLoggedIn, isOpen, isPermanentNegative, isPositiveCompletion, isPositiveIntermediate, isPositivePreliminary, isSecure, isTransientNegative, login, logout, open, parseAddress, parseExtAddress, passiveDataConnection, receiveServerReadyReply, remove, removeDirectory, rename, sendCommand, sendEPRT, sendEPSV, sendPASV, sendPORT, sendPassiveCommand, sendPortCommand, setFileType, setPassive, setTimeout, setWorkingDirectory, systemType, welcomeMessage

Constructors

FTPSClientSession

FTPSClientSession();

Creates an FTPSClientSession.

Passive mode will be used for data transfers.

FTPSClientSession

explicit FTPSClientSession(
    Context::Ptr pContext
);

Creates an FTPSClientSession using the given Context.

Passive mode will be used for data transfers.

FTPSClientSession

FTPSClientSession(
    const StreamSocket & socket,
    bool readWelcomeMessage = true,
    bool enableFTPS = true,
    Context::Ptr pContext = nullptr
);

Creates an FTPSClientSession using the given connected socket for the control connection.

If readWelcomeMessage is true (the default), the welcome reply sent by the server on connect is read from the socket. Pass false only if the welcome reply has already been read from the socket; see FTPClientSession for the implications.

Passive mode will be used for data transfers.

FTPSClientSession

FTPSClientSession(
    const std::string & host,
    Poco::UInt16 port = FTP_PORT,
    const std::string & username = "",
    const std::string & password = "",
    Context::Ptr pContext = nullptr
);

Creates an FTPSClientSession using a socket connected to the given host and port. If username is supplied, login is attempted.

Passive mode will be used for data transfers.

Destructor

~FTPSClientSession virtual

virtual ~FTPSClientSession();

Member Functions

allowPlaintextFallback inline

void allowPlaintextFallback(
    bool allow = true
);

Allow the session to continue unencrypted if the server refuses both AUTH TLS and AUTH SSL. Must be set before the first command, so it cannot be combined with the constructor that takes credentials: that form logs in immediately and always requires TLS.

Disabled by default: otherwise a server that simply denies both commands downgrades the session, and the credentials passed to login() are then sent in the clear.

enableFTPS

void enableFTPS(
    bool enable = true
);

Enable or disable FTPS (FTP over SSL/TLS).

forceSessionReuse inline

void forceSessionReuse(
    bool force = true
);

Enable or disable session reusing

isPlaintextFallbackAllowed inline

bool isPlaintextFallbackAllowed() const;

Returns true if the session may continue unencrypted when the server refuses to start TLS.

isSecure inline

bool isSecure() const;

Returns true if the session is FTPS.

establishDataConnection protected virtual

virtual StreamSocket establishDataConnection(
    const std::string & command,
    const std::string & arg
);

Create secure data connection

receiveServerReadyReply protected virtual

virtual void receiveServerReadyReply();

Function that read server welcome message after connetion and set and make secure socket