WebDAV with untrusted SSL cert from .NET
I am trying to connect to a WebDAV server with a self-signed certificate using the .NET assembly. I can connect to the same server with the WebDAV protocol on a different port (and with the WinSCP GUI) without SSL but I can't figure out the correct options to set to get SSL working.
If I don't supply the server's host certificate fingerprint, I get the error (as expected):
If I supply the certificate fingerprint with SessionOptions.TlsHostCertificateFingerprint, I get the error:WinSCP.SessionRemoteException: Server certificate verification failed: certificate issued for a different hostname, issuer is not trusted ---> WinSCP.SessionRemoteException: Connection failed.
So then if I set SessionOptions.FtpSecure to FtpSecure.Implicit, I get the error:System.ArgumentException: SessionOptions.TlsHostCertificateFingerprint or SessionOptions.GiveUpSecurityAndAcceptAnyTlsHostCertificate is set, but SessionOptions.FtpSecure is FtpSecure.None.
Is there anything else I can try?System.ArgumentException: SessionOptions.FtpSecure is not FtpSecure.None, but SessionOptions.Protocol is not Protocol.Ftp.