X509Certificate2Collection ResolveDomain(DnsClient client, string name) { name = name.Replace('@', '.'); try { IEnumerable <CertRecord> records; if (m_useRootForCertResolve) { records = client.ResolveCERTFromNameServer(name); } else { records = client.ResolveCERT(name); } if (records != null) { return(CollectCerts(null, records)); } } catch (DnsServerException dnsEx) { if (dnsEx.ResponseCode != DnsStandard.ResponseCode.Refused) { throw; } } catch (Exception ex) { this.Error.NotifyEvent(this, ex); throw; } return(null); }
private void ResolveCert(DnsClient client, string domain) { IEnumerable <DnsResourceRecord> expectedMatches = s_recordTable[domain, DnsStandard.RecordType.CERT]; client.UseUDPFirst = false; IEnumerable <CertRecord> matches = client.ResolveCERT(domain); Assert.True(Equals(matches, expectedMatches)); }