I have a multi-threaded application that calls a number of URL’s from Parallel.ForEach loop. For some of those URL’s I need to ignore bad certificates for some I should not.
ServicePointManager.ServerCertificateValidationCallback seems to provide global handling of all certificate validation callbacks.
Can anyone give a suggestion on how I can selectively accept bad certificates in a mutli-threaded Parallel.ForEach() call?
It seems like the best way to do this is to make a HashSet of URL’s to ignore. If the url isn’t something in your set of url’s to ignore, then you can deal with bad certificates.