private void RegistrationValidator_CertificateValidation(CertificateValidator sender, CertificateValidationEventArgs e)
{
System.Net.IPAddress[] targetAddresses = System.Net.Dns.GetHostAddresses(System.Net.Dns.GetHostName());
foreach (string domain in Utils.GetDomainsFromCertficate(e.Certificate))
{
System.Net.IPAddress[] actualAddresses = System.Net.Dns.GetHostAddresses(domain);
foreach (System.Net.IPAddress actualAddress in actualAddresses)
{
foreach (System.Net.IPAddress targetAddress in targetAddresses)
{
if (targetAddress.Equals(actualAddress))
{
e.Accept = true;
return;
}
}
}
}
}