Rebex FTP+SSL Certificate Warning

0 votes
asked Jan 10, 2012 by dm3281 (230 points)
edited Jan 10, 2012

Hi -

I'm experimenting with Rebex FTP+SSL and have it working with FileZilla Server and FTP+SSL Explicit. Latest build of Rebex FTP.

Since I only installed a self-signed cert within FileZilla and have it installed on my local development machine, I'm trying to test a simple C# console application.

Similar to FileZilla Client or other FTPS command line programs, I would like to display a warning message and the certificate information for client to accept or cancel when trying to connect to an FTP+SSL server; if the client cannot verify the certificate.

How can I accomplish this?

Also, when the user response is received, Yes to continue or No to abort... is there a way I can also have a Yes and Accept where the certifcate can be trusted; even though it cannot be verified?

Any help or sample code would be appreciated.

Applies to: Rebex FTP/SSL

1 Answer

+1 vote
answered Jan 10, 2012 by Lukas Pokorny (120,490 points)
edited Jan 10, 2012
Best answer

The ConsoleClient sample (installed with Rebex FTP/SSL) contains ConsoleVerifier.cs/.vb files that does most of this (it doesn't offer a permanent 'Accept').

The WinFormClient sample (installed with Rebex FTP/SSL as well) contains a Windows Forms version of a similar code - see Verifier.cs/.vb and VerifierForm.cs/.vb files - and it also demonstrates how to add an untrusted root certificate (this includes self-signed certificates) into the current user's "Root CAs" certificate store (to make them automatically trusted the next time). A similar code would work in a console application as well.