Quantcast
Channel: Alex FTPS Client
Viewing all 114 articles
Browse latest View live

Patch Uploaded: #15386

$
0
0

rufwork has uploaded a patch.

Description:
Some FTPS servers -- namely FileZilla -- may easily be accidentally configured to report local IP addresses, even when accessed remotely where private IP blocks are inaccessible. See description here:

https://forum.filezilla-project.org/viewtopic.php?t=14750

When a local address is reported, this FTPS client should at least optionally fall back and use the ctrlClient.Client.RemoteEndPoint's IP address (though not its port) to continue operation.

This is intended to be a non-destructive fix. If one is properly using a private IP on a private network, ctrlClient.Client.RemoteEndPoint will retain that initial local IP. The check for private IP usage could be added as an option, but because of the non-destructive nature of the fix and its reasonably low overhead, it is currently "always on" in PasvCmd(). See AvoidMisreportedIP() in FTPSClient.cs.

This is essentially what the FileZilla client does, for instance, to work around this situation.

Command: PASV
Response: 227 Entering Passive Mode (10,0,0,17,255,250)
Status: Server sent passive reply with unroutable address. Using server address instead.


New Post: Active mode overrides

$
0
0
Perfect for me....

I made also some internal modifications for exemple to access finall IPAdress when proxy is used, etc...

But I get still some difficulties when DNS named server , especially dyndns ones.

Any Idea ?

New Post: Limitation on length of Folder Name plus File Name

$
0
0
Is there a limit on the number of characters one can have in a folder name + file name when specifying a directory to either upload from or download to? I seem to have a problem when the combo is fairly long.

Thanks

New Post: alex ftps error - Policy requires SSL.

$
0
0
IIS7-> we have enabled checkbox Require ssl connections. our code is as follows. we are using a valid certficate generated by CA.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AlexPilotti.FTPS.Client;
using AlexPilotti.FTPS.Common;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;

namespace FTPSTest
{
class Program
{
    static void Main(string[] args)
    {
        using (FTPSClient client = new FTPSClient())
        {

            client.Connect("000.00.000.000", new NetworkCredential("user1","Password"), ESSLSupportMode.CredentialsRequired | ESSLSupportMode.DataChannelRequested, new RemoteCertificateValidationCallback(ValidateTestServerCertificate));
            client.PutFile("tryme.txt", "tryme.txt");
        }


    }
    private static bool ValidateTestServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
    {



       if (sslPolicyErrors == SslPolicyErrors.None)
            return true;
        else
        {
            return false;
        }

    }

}
}
*************************************8
we are GETTING BELOW ERROR
AlexPilotti.FTPS.Common.FTPCommandException was unhandled
Message=Policy requires SSL.
Source=AlexPilotti.FTPS.Client
ErrorCode=534
StackTrace:
   at AlexPilotti.FTPS.Client.FTPSClient.GetReply()
   at AlexPilotti.FTPS.Client.FTPSClient.HandleCmd(String command, Boolean waitForAnswer)
   at AlexPilotti.FTPS.Client.FTPSClient.HandleCmd(String command)
   at AlexPilotti.FTPS.Client.FTPSClient.CccCmd()
   at AlexPilotti.FTPS.Client.FTPSClient.SSlCtrlChannelCheckRevertToClearText()
   at AlexPilotti.FTPS.Client.FTPSClient.Connect(String hostname, Int32 port, NetworkCredential credential, ESSLSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate, X509Certificate x509ClientCert, Int32 sslMinKeyExchangeAlgStrength, Int32 sslMinCipherAlgStrength, Int32 sslMinHashAlgStrength, Nullable`1 timeout, Boolean useCtrlEndPointAddressForData, EDataConnectionMode dataConnectionMode)
   at AlexPilotti.FTPS.Client.FTPSClient.Connect(String hostname, Int32 port, NetworkCredential credential, ESSLSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate, X509Certificate x509ClientCert, Int32 sslMinKeyExchangeAlgStrength, Int32 sslMinCipherAlgStrength, Int32 sslMinHashAlgStrength, Nullable`1 timeout, Boolean useCtrlEndPointAddressForData)
   at AlexPilotti.FTPS.Client.FTPSClient.Connect(String hostname, Int32 port, NetworkCredential credential, ESSLSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate, X509Certificate x509ClientCert, Int32 sslMinKeyExchangeAlgStrength, Int32 sslMinCipherAlgStrength, Int32 sslMinHashAlgStrength, Nullable`1 timeout)
   at AlexPilotti.FTPS.Client.FTPSClient.Connect(String hostname, NetworkCredential credential, ESSLSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate)
   at FTPSTest.Program.Main(String[] args) in C:\Users\user1\Documents\Visual Studio 2010\Projects\FTPSTest\FTPSTest\Program.cs:line 36
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
InnerException:

it works when checkbox "Allow ssl connections" is enabled
but doesnt work if checkbox "Require ssl connections" checkbox is enabled.
what could be the reason???

New Post: alex ftps error - Policy requires SSL.

$
0
0
it is working with below code..

client.Connect("000.00.000.000", port, new NetworkCredential("user1", "Password"), ESSLSupportMode.All, new RemoteCertificateValidationCallback(ValidateTestServerCertificate), new X509Certificate(), 0, 0, 0, System.Threading.Timeout.Infinite);

client.PutFile("Tester.txt", "Tester.txt");

New Post: Error: The remote certificate is invalid according to the validation procedure.

$
0
0
Hi,
I get the above error when I connect to the ftps server. The below is my code. Note that the url has ftps instead of ftp. 
client.Connect("ftps.abc.xy.com", new NetworkCredential(userName,password),
                                            ESSLSupportMode.CredentialsRequired | ESSLSupportMode.DataChannelRequested);
Is my syntax incorrect? What might be causing this issue? Also, I was able to connect to this server through FileZilla but using the "SFTP" protocol.

New Post: Can some one share the code to Upload single files N times ??

$
0
0
The code that I have written gets the FTPSstream and writes byte and closes the stream. however this is prevents multiple times file upload.

New Post: Support for VMS?


New Post: Why does AlexFTPS complaints "WARNING: SSL/TLS remote certificate chain errors"?

$
0
0
I had the same kind of issues.
Working with Filezilla or IIS or creating a certificate with openssl.
I allways had a chain error and couldn't figure out how was filled the sslPolicyErrors variable.

I decided to rewrite ValidateTestServerCertificate in the DLL FTPSClient to read directly the store certificate.
    public static bool ValidateTestServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
    {
        bool certOk = false;

        DateTime effectiveDate = Convert.ToDateTime(certificate.GetEffectiveDateString());
        DateTime expirationDate = Convert.ToDateTime(certificate.GetExpirationDateString());

        if (effectiveDate.CompareTo(System.DateTime.UtcNow) < 0 && expirationDate.CompareTo(System.DateTime.UtcNow) > 0)
        {
            X509Store store = new X509Store(StoreLocation.LocalMachine);
            store.Open(OpenFlags.ReadOnly);

            for (int i = 0; i < store.Certificates.Count; i++)
            {
                X509Certificate2 certCollection = store.Certificates[i];
                if (certCollection.Equals(certificate)) certOk = true;
            }
        }
        return certOk;
    }
In my program, I call it this way :
   client.Connect(...,new RemoteCertificateValidationCallback(FTPSClient.ValidateTestServerCertificate),...);
So far, it seems to work.
Alex, any other major checks I coud had to my tests ?
Thanks

Hope this helps.
Cheers
Nicolas

New Post: Skip existing files

$
0
0
When using the "GetFiles" to download a full directory, how do I skip files that already exists on my download location?

New Post: Script does not complete as Scheduled Task

$
0
0
I upload several files files nightly to an FTP server from three different servers. The task is scripted and sends an e-mail to me of the completed AlexFTP log.

For two servers, the files are uploaded without a problem and the result of the completed upload e-mailed to me. On the server with the issue, the only part that I receive from the log is below and no files are uploaded:

Alex FTPS version 1.1.0
Copyright (C) Alessandro Pilotti 2008-2009

http://www.codeplex.com/ftps
info@pilotti.it This is free software, you may use it under the terms of
the LGPL license http://www.gnu.org/copyleft/lesser.html

I run the script from the command line and it works fine uploading although there is a slight pause on this server when the connection to the ftp server is made and the above text appears on screen before the upload starts.

Imported the task from the other servers that work and still get the same results.

Any ideas?

PS: I am a big fan of AlexFTP.


Example of a completed log file:

Alex FTPS version 1.1.0
Copyright (C) Alessandro Pilotti 2008-2009

http://www.codeplex.com/ftps
info@pilotti.it This is free software, you may use it under the terms of
the LGPL license http://www.gnu.org/copyleft/lesser.html

Source (local): D:\Backup\midnight\Tue\File.zipx
Dest (remote): /Upload/File.zipx
File Size: 266,800,408 Byte

0% 100%
...............................................................................
Elapsed time: 00:00:27.68 - Average rate: 9,412.15 KB/s

Uploaded files: 20

New Post: Connection succesfull - other commands fail

$
0
0
Hi Alessandro

I have exactly the same problem now with a new project and version 1.1.0.
When I read descriptions of context, error and errormessages all is very similar.

I use the dll in a VB.NET project.

ftps is defined as FTPSClient before this code:

ftps = New FTPSClient()
Dim auth As New NetworkCredential(username, password)
ftps.Connect(address, 990, auth, AlexPilotti.FTPS.Client.ESSLSupportMode.Implicit, New RemoteCertificateValidationCallback(AddressOf ValidateServerCertificate), Nothing, 0, 0, 0, Nothing, True)

I can connect without problems but not get beyond GetDirectoryList()
I tried the connect method after reading about the useCtrlEndPointAddressForData parameter, but it dis not help.

Any ideas where to start?

Regards Jorgen

New Post: FTP SSL Implicit failed with error "AuthenticationException: A call to SSPI failed"

$
0
0
Hi Alex,

I really love this library and using it for my application that works with FTP. Recently, our client wants to support FTP with SSL and we got a problem with it.
For investigating, I created a console application and ran the code to test connection, download files from a FTP Server with Implicit SSL and it worked perfectly on live server. However, when I ran my application on the server (Windows Form VB.Net 4.5) that ran a background thread to do the same work as above (connect & download files from that FTP with Implicit SSL) but it failed with below error. Also, I tried to run the app on my local machine => it worked perfectly.
Could you please help me to check this and give me your advices when you have chance to check?

Many thanks,
Doanh

System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The message received was unexpected or badly formatted
--- End of inner exception stack trace ---
at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)
at AlexPilotti.FTPS.Client.FTPSClient.CreateSSlStream(Stream s, Boolean leaveInnerStreamOpen) in e:\data from D\Neil Britto\SVN04102013\trunk\ETECH.EDI\FTPSClient\FTPSClient.cs:line 1794
at AlexPilotti.FTPS.Client.FTPSClient.SwitchCtrlToSSLMode() in e:\data from D\Neil Britto\SVN04102013\trunk\ETECH.EDI\FTPSClient\FTPSClient.cs:line 1771
at AlexPilotti.FTPS.Client.FTPSClient.Connect(String hostname, Int32 port, NetworkCredential credential, ESSLSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate, X509Certificate x509ClientCert, Int32 sslMinKeyExchangeAlgStrength, Int32 sslMinCipherAlgStrength, Int32 sslMinHashAlgStrength, Nullable`1 timeout, Boolean useCtrlEndPointAddressForData, EDataConnectionMode dataConnectionMode, String account) in e:\data from D\Neil Britto\SVN04102013\trunk\ETECH.EDI\FTPSClient\FTPSClient.cs:line 558
at AlexPilotti.FTPS.Client.FTPSClient.Connect(String hostname, NetworkCredential credential, ESSLSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate, Boolean isActiveTransferMode, String account) in e:\data from D\Neil Britto\SVN04102013\trunk\ETECH.EDI\FTPSClient\FTPSClient.cs:line 433
at ETECH.EDI.Library.Ftp.FtpsHelper.DownloadFile(String remoteFile, String localFile, FtpInfoBase ftpInfo, Boolean allowOverrideExistedLocalFile, String& errorMessage) in e:\data from D\Neil Britto\SVN04102013\trunk\ETECH.EDI\ETECH.EDI.Library.Ftp\FtpsHelper.cs:line 309.

New Post: Trouble with UNISYS 2200 server

$
0
0
Alex,

I am using your API to FTPs to a UNISYS 2200 system. When this command is run, all it does it generate a folder on the client called "test.html" with no contents
.\ftps -h hostip -port 990 -U username -password ********* -ssl Implicit -sslClientCertPath E:\Certs\FTPS.cer -sslMinCipherStrength 128 -sslMinHashStrength 128 -sslMinKeyExStrength 128 -sslInvalidServerCertHandling Accept -g Qual*file. E:\test.html -dm Active -tm ASCII
When this command is run, it hangs. By monitoring the connection with wireshark I can see a hung <ACK>.
.\ftps -h hostip -port 990 -U username -password ********* -ssl Implicit -sslClientCertPath E:\Certs\FTPS.cer -sslMinCipherStrength 128 -sslMinHashStrength 128 -sslMinKeyExStrength 128 -sslInvalidServerCertHandling Accept -put "E:\text.txt" "qual*file.text" -dm Active -tm ASCII
All control commands work (-sys, -feat). But, none of the data channel commands seem to work.

New Post: PROT P required


New Post: Active mode FTP C#

$
0
0
I cannot find any information about setting up active mode FTP connection in C# AlexPilotti.FTPS. Is there such a possibility? If there is, then what is the way to implement it in code?
Need an answer ASAP

New Post: Active mode FTP C#

$
0
0
Oh, I am sorry for being an idiot and not noticing the obvious right under my nose :)
One of the several overrides for FTPSClient.Connect(...) has a last parameter of type enum EDataConnectionMode.
public string Connect(string hostname, int port, NetworkCredential credential, ESSLSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate, X509Certificate x509ClientCert, int sslMinKeyExchangeAlgStrength, int sslMinCipherAlgStrength, int sslMinHashAlgStrength, int? timeout, bool useCtrlEndPointAddressForData, EDataConnectionMode dataConnectionMode);

Reviewed: AlexFTPS Client 1.1.0 (Aug 19, 2014)

$
0
0
Rated 2 Stars (out of 5) - i am getting error like "no connection could be made because the target machine actively refused" code not working

New Post: Need help with Configuration

$
0
0
I'm using the .Net Library on Visual Studio with VB.net. I'm really new and i'm almost know nothing. But i really want to make this to work. I used WinSCP before and i can Connect to my FTP Server with the settings like this
.Protocol = Protocol.Ftp
.HostName = "xxx.xxx.xxx.xxx"
.UserName = "xxxxxx"
.Password = "xxxx"
.TlsHostCertificateFingerprint = "xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
.FtpSecure = FtpSecure.ExplicitTls

So how can i make a it to work with Alex FTPS Client? Please Help me

New Post: How can I upload a file using TLS 1.0?

$
0
0
Hi All,

I am using the below vb.net code for uploading the files. We were asked to use TLS 1.0 Since SSL is no more supported. Could you please help me how can I use TLS 1.0?

Using client As New FTPSClient()
            client.Connect("ftp.abebooks.com", New NetworkCredential("xxxxx", "xxxxx"), ESSLSupportMode.CredentialsRequired Or ESSLSupportMode.DataChannelRequested)
            client.PutFile("E:\test.txt", "Abe" + "_Test" + DateTime.Now.ToString("yyyyMMddHH") + DateTime.Now.Ticks.ToString() + "." + "txt")
        End Using
Viewing all 114 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>