How is the following code evaluated?开发者_运维知识库
ServicePointManager.ServerCertificateValidationCallback += ValidateRemoteCertificateA;
ServicePointManager.ServerCertificateValidationCallback += ValidateRemoteCertificateB;
Given an HttpWebRequest, is it enough if one of the Validator methods returns true, or do they both have to return true? i.e.
ValidateRemoteCertificateA && ValidateRemoteCertificateB
or
ValidateRemoteCertificateA || ValidateRemoteCertificateB
?
Cheers, tamberg
It will use the return value of the last delegate added, in all cases.
ServerCertificateValidationCallback
is a multicast delegate property.
Writing ServerCertificateValidationCallback += x
appends x
to its invocation list.
The return value of a multicast delegate is the return value of the last delegate in its list.
精彩评论