You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a WebDAV server on a local network, to access it over TLS/SSL I have to set up a certificate with a dummy CA, which is quite annoying.
Can I disable the SSL certificate validation? (Yes I know that this way I'd be losing the trusted CA)
I've found a solution for an HttpClienthere, but I'm not sure if/how to employ it with WebDavClient
The text was updated successfully, but these errors were encountered:
@skazantsev That sounds fine, however, I have to admit I have no idea how to pass on the credentials that previously I entered with WebDavClientParams.Credentials ... I mean that otherwise I just filled in a WebDavClientParams object and pass it to the WebDavClient constructor, as in base examples
Oh well, I made it, no matter how dumb I am 😄
I just changed the code to this
var httpClientHandler = new HttpClientHandler();
httpClientHandler.ServerCertificateCustomValidationCallback = ( message, cert, chain, sslPolicyErrors ) =>
{
return true;
};
httpClientHandler.Credentials = new NetworkCredential( "user", "password" );
HttpClient httpClient = new HttpClient( httpClientHandler ) { BaseAddress = new Uri( server ) };
WebDavClient client = new WebDavClient( httpClient );
And that worked, even removing the dummy CA, so without a trusted CA. Great! Still: this is a restricted use, on a local network, possibly not even connected to the internet. I understand that using it outside a controlled environment isn't a good idea!
I have a WebDAV server on a local network, to access it over TLS/SSL I have to set up a certificate with a dummy CA, which is quite annoying.
Can I disable the SSL certificate validation? (Yes I know that this way I'd be losing the trusted CA)
I've found a solution for an
HttpClient
here, but I'm not sure if/how to employ it with WebDavClientThe text was updated successfully, but these errors were encountered: