Home Forums .NET libraries Xceed SFTP/FTP for .NET An SSL error occurred while sending a command

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

    This is the error that I’m receiving, in the CertificateReceived event I am accepting the certificate no matter what, so why does this error come up on my Authenticate method call?

     

    try

    {

    Console.Write(“Attempting to authenticate the SSL certificate…”);

    xClient.Authenticate(Xceed.Ftp.

    AuthenticationMethod.Ssl, Xceed.Ftp.VerificationFlags.None, clientCert, Xceed.Ftp.DataChannelProtection.Private);

    Console.WriteLine(” Certificate authentication succeeded.”);

    }

    catch (Exception ex)

    {

    Console.WriteLine();

    Console.WriteLine(“Authentication failed: “ + ex);

    throw new Exception(“An error occurred authenticating with the secure FTP server. “ + ex.Message, ex);

    }

     

    // The Status argument property tells you if the server certificate was accepted based on the VerificationFlags you provided.

    if (e.Status != Xceed.Ftp.VerificationStatus.ValidCertificate)

    {

    Console.WriteLine(“The server certificate is invalid: {0}”, e.Status.ToString());

    Console.WriteLine(e.ServerCertificate.ToString());

    // Even though this certificate is not valid, we are going to accept it because we at least received one.

    // In the future, if we want to get more technical about the certificates, this is the place to check the

    // details about the invalid cert.

    e.Action = Xceed.Ftp.

    VerificationAction.Accept;

    }

    else

    Console.WriteLine(“Valid certificate received from server.”);

     

    Stack Trace:

    Authentication failed: 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)
       — End of inner exception stack trace —
       at Xceed.Utils.Security.Ssl.SecureSocket.EndSend(IAsyncResult asyncResult)
       at Xceed.Utils.Security.Ssl.SecureSocket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
       at Xceed.Ftp.Engine.FtpCommandChannel.SendString(String command)
       — End of inner exception stack trace —
       at Xceed.Ftp.Engine.FtpCommandSequence.EndExecute(IAsyncResult asyncResult)
       at Xceed.Ftp.FtpClient.Authenticate(FtpCommandChannel commandChannel, AuthenticationFtpCommand authCommand, DataChannelProtectionFtpCommand protCommand)
       at Xceed.Ftp.FtpClient.Authenticate(AuthenticationMethod authenticationMethod, VerificationFlags verificationFlags, Certificate clientCertificate, DataChannelProtection dataProtection)
       at

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

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi ganders,

    The stack trace seems to indicate that the source of the issue is with the remote host rather than with the Xceed component:

    —> 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.

     

    If you believe that the Xceed component is at fault, then we will need a small stand-alone sample project that reproduces the issue in order to investigate further. Please send it by email at support@xceed.com and include a link to this forum thread for reference. Thank you.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Diane [Xceed] (had 601 views)

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