The .NET API is not working with the new 1.x.x versions of FileZilla Server.
Th primary reason is that the Administrative GUI now requires TLS.
I have tried (with little success) to connect to the server with the following .NET Code:
Code: Select all
TcpClient client = new TcpClient();
client.Connect(Ip, Port);
var sslStream = new SslStream(client.GetStream(), false, new RemoteCertificateValidationCallback(CertificateValidationCallback), null);
var cert = new X509Certificate2("selfsign.pfx", "");
var certs = new X509Certificate2Collection {cert};
const SslProtocols allowedProtocols = SslProtocols.Tls12;
sslStream.AuthenticateAsClient("127.0.0.1", certs, allowedProtocols, true);
However I get no response when sending commands - or I get a message "Not enough data" which seems to originate from GnuTLS.
Questions:
- Is the above code correct or am I doing something wrong?
- Should I use my own certificate or the same certificate as configured in GUI?
- Is the GUI "command API" that same or has it changed too?