WebDAVClient icon indicating copy to clipboard operation
WebDAVClient copied to clipboard

ServerCertificateValidationCallback

Open giviglie opened this issue 7 years ago • 2 comments

Not clear how to use it. Always getting a TLS error message and callbeck is never called.

Thanks

giviglie avatar Jun 20 '18 14:06 giviglie

Indeed, the usage is not detailed here. You can refer to https://docs.microsoft.com/en-us/dotnet/api/system.net.security.remotecertificatevalidationcallback?redirectedfrom=MSDN&view=netframework-4.7.2

However, I'm trying to access a synology NAS through WebDAV and like @giviglie , the callback seems to never be called. I just added a "return true;" in the callback but the client continues to say that the certificate can't be validated.

pYThMik avatar Aug 24 '18 14:08 pYThMik

Did you make sure to register your callback:

ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateCertificate);

Which version of .Net are you using? .Net Framework 4.x? .Net Core 2.x? .Net Core 3.x

saguiitay avatar Aug 25 '21 17:08 saguiitay