Welcome to the Xceed Community | Help
Community Search  
More Search Options

The handshake failed due to unexpected error format

Sort Posts: Previous Next
  •  09-17-2009, 1:27 AM Post no. 24006

    The handshake failed due to unexpected error format

    Hi

    I am using a simple ftpclient  connect call to the server

     ftp.Connect("localhost", 21, AuthenticationMethod.Ssl, VerificationFlags.AllFlags, null);

     

    but get this error "Handshake failed due to unexpected error format" with details saying {"An error occurred while creating the SslStream."}

    I have tried connecting to many servers like filezilla, win2k3, win2k8 new ftp service but with explicit ssl  everytime same error comes though implicit ssl connection with port 990 seems to work fine.

    Has anyone seen this issue and can suggest the fix..it is urgent

    Thanks
  •  12-17-2009, 10:26 AM Post no. 25245 in reply to 24006

    Re: The handshake failed due to unexpected error format

    Hi,

    You should try to using "VerificationFlags.None" to make sure that you can connect.  We know that there is a cast problem with the VerificationFlags class and this problem should fixed next week in a service release. 

    Best regards,


    Ghislain
    Technical Support and software developer
    Xceed Software Inc.
    Knowledge Base : http://xceed.com/kb/
    Update Center : http://xceed.com/updates/
    Documentation Center : http://xceed.com/doc/
    For everything else, there is Google
  •  11-14-2011, 2:33 AM Post no. 31330 in reply to 25245

    Re: The handshake failed due to unexpected error format

    Hi Ghislain,

    I'm using Xceed FTP 4.1 . I'm trying to connect FTP server which is hosted on WIndows Server 2008. I can able to transfer the file with normal FTP, but when I'm trying with SSL, its throwing below error...

    The handshake failed due to an unexpected packet format.

    SslStream authentication failed. Possible causes: 1) The server requires a certificate in order to connect and none was provided. 2) The certificate provided was rejected by the .NET framework/Windows (usually because it doesn't contain a private key). 3) The certificate provided was rejected by the server.

    Here is my code:

    using XFTP = Xceed.Ftp;

    XFTP.AsyncFtpClient ftpClienti = new Xceed.Ftp.AsyncFtpClient();

    ftpClienti.PassiveTransfer = true;

    ftpClienti.CertificateReceived += new XFTP.CertificateReceivedEventHandler(certificate_received);

    ftpClienti.Connect("server", 990, XFTP.AuthenticationMethod.Tls, XFTP.VerificationFlags.None, null);

    ftpClienti.Login(FtpUsername, FtpPassword);

    I have installed the FTP SSL certificate also.. still its throwing SslStream authentication failed exception.

    Can you please help on this?

     

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.