private SocketProvider initDataSocket(Command command, Reply commandReply)
            throws IOException, FtpIOException, FtpWorkflowException {
        
        setConnectionStatusLock(CSL_INDIRECT_CALL);
        setConnectionStatus(FTPConnection.BUSY);
        
    	if(isPretSupport())
    	{
    		Command pretCommand = new Command(Command.PRET,command.toString());
    		sendCommand(pretCommand).dumpReply();
    	}
        InetSocketAddress dataSocket = sendPassiveMode();
        SocketProvider provider = new SocketProvider(false);
        provider.connect(dataSocket, getProxy(), getDownloadBandwidth(),
                getUploadBandwidth());
        provider.setSSLMode(getConnectionType());

        commandReply.setLines(sendCommand(command).getLines());
        commandReply.dumpReply();
        commandReply.validate();

        if (connectionType == FTPConnection.AUTH_TLS_FTP_CONNECTION
                || connectionType == FTPConnection.AUTH_SSL_FTP_CONNECTION
                || connectionType == FTPConnection.IMPLICIT_SSL_WITH_CRYPTED_DATA_FTP_CONNECTION
                || connectionType == FTPConnection.IMPLICIT_TLS_WITH_CRYPTED_DATA_FTP_CONNECTION)
            provider.negotiate(this.getTrustManagers(),this.getKeyManagers());

        setConnectionStatus(FTPConnection.IDLE);
        setConnectionStatusLock(CSL_DIRECT_CALL);
        
        return provider;
    }