Home Forums .NET libraries Xceed SFTP/FTP for .NET Unable to connect using Explicit SSL

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20916 |

    Hey all,

    I’m having some trouble getting a connection to a local FTP server using SSL [explicit]. Specifically, after attempting to authenticate, I get an unhandled FtpSslException w/ a message:

    “The other side has sent a failure alert.”

    Here is my C# code:

    private static void Connect()
    {
    AsyncFtpClient client = new AsyncFtpClient();
    StringWriter sw = new StringWriter();
    try
    {
    client.TraceWriter = sw;
    client.PassiveTransfer = true;
    client.CertificateReceived += new CertificateReceivedEventHandler(certificate_received);
    Certificate clientCert = null;

    IAsyncResult result = client.BeginConnect(“192.168.2.106”, null, null);

    while(!result.IsCompleted)
    Application.DoEvents();

    client.EndConnect(result);

    IAsyncResult result2 = client.BeginAuthenticate(AuthenticationMethod.Ssl, VerificationFlags.None, clientCert, DataChannelProtection.Private, null, null);

    while(!result2.IsCompleted)
    Application.DoEvents();

    client.EndAuthenticate(result2);

    client.Login(“user”, “pwd”);

    client.Disconnect();

    client.CertificateReceived -= new CertificateReceivedEventHandler(certificate_received);
    }
    catch(Exception ex)
    {
    sw.WriteLine();
    sw.WriteLine(ex.ToString());
    }
    finally
    {
    YellowCup.Library.IO.WriteToFile(sw.ToString(), “D:\\Temp\\ftp.log”);
    sw.Close();
    }
    }

    private static void certificate_received(object sender, CertificateReceivedEventArgs e)
    {
    e.Action = VerificationAction.Accept;
    }

    Here is the trace information after executing said code:

    Connected to 192.168.2.106:21 on 7/14/2007 @ 11:31:32 AM
    < 220 Hello, I’m freeFTPd 1.0
    > AUTH SSL
    < 234 Go on, authenticate!
    > PBSZ 0
    Error sending command: An error occured while communicating with the remote host.
    Disconnected from 192.168.2.106:21 on 7/14/2007 @ 11:31:33 AM

    And this is more information regarding the exception that is thrown at EndAuthenticate:

    Xceed.Ftp.FtpSslException: An SSL error occurred while sending a command. —> Xceed.Utils.Security.SecurityException: An error occured while communicating with the remote host. —> Xceed.Utils.Security.Ssl.Shared.SslException: The other side has sent a failure alert.
    at Xceed.Utils.Security.Ssl.Shared.HandshakeLayer.ProcessAlert(RecordMessage message)
    at Xceed.Utils.Security.Ssl.Shared.HandshakeLayer.ProcessMessages(RecordMessage message)
    at Xceed.Utils.Security.Ssl.Shared.RecordLayer.ProcessBytes(Byte[] buffer, Int32 offset, Int32 size)
    at Xceed.Utils.Security.Ssl.Shared.SocketController.OnReceive(IAsyncResult ar)

    I’m connecting to a machine local to my network, running freeFTPd + SSL. I am connecting thru port 21 using SSL v3.0.

    Implicit SSL connections over prot 990 work great, as does normal FTP over port 21. The only scenario I cannot get working is Exlpicit SSL over port 21.

    Much appreciation for any help – been stuck for days on this!

    Cheers,
    Bobby

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by bderosa (had 4003 views)

    User (Old forums)
    Member
    Post count: 23064

    I’d also like to mention that I’m using v3.5.7326.14130

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by bderosa (had 267 views)

    Xceed Support
    Member
    Post count: 5658

    First, could you try connecting with TLS authentication?

    If it still does not work, you could verify if your server is correctly configure to accept explicit connection on port 21. Normally, this should work but it is possible that freeFTPd does not support this type of authentication.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by CharlesB (had 3958 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.