Home Forums .NET libraries Xceed SFTP/FTP for .NET NoCNMatch using TLS Authentication

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

    I am receiving the message “The server certificate is invalid: NoCNMatch” when trying to connect to an external server using TLS authentication. Is there a way to set the call to automatically accept the certificate and ignore this error?

    Also, another route that I was trying to take was to pass an X509 Certificate but I can’t figure out how to set the key as well, I get the message: “If a certificate is specified, it must have a private key.” but I can’t find a way to set the private key.

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

    User (Old forums)
    Member
    Post count: 23064

    I forgot to mention that I am using version 3.5

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

    Xceed Support
    Member
    Post count: 5658

    Are you handling the OnCertificateReceived event? You can accept the certificate in the OnCertificateReceived event. Here is a code snippet that should help you:

    <code>
    //In the code
    FtpClient client = new FtpClient();
    client.CertificateReceived += new CertificateReceivedEventHandler( this.OnCertificateReceived );

    //The OnCertificateReceived event handler
    private void OnCertificateReceived( object sender, CertificateReceivedEventArgs e )
    {
    if( e.Status != VerificationStatus.ValidCertificate )
    {
    e.Action = VerificationAction.Accept;
    }
    }
    </code>

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

    User (Old forums)
    Member
    Post count: 23064

    Yep, I am using Code Snippet’s 4.1.3 as well as 4.2.3.3 for my initial testing and I have put the code into an ASP .Net website as well.

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

    Xceed Support
    Member
    Post count: 5658

    Could you send a log of the communication with the server, by setting the TraceWriter property?

    FtpClient.TraceWriter = new StreamWriter( @”D:\ftp.log”, true );

    Could we also get access to your server so we can reproduce the issue here? If so, send the information to <a href=”mailto:support@xceedsoft.com”>support</a>, along with a reference to this post.

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

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