X509CertificateValidator 내에서이를 수행 할 수있는 방법을 찾지 못했지만 서비스 내에서 가능합니다.
여기가 내 첫 번째 단편입니다. 더 세련되게하기 위해 세련 될 것입니다. 그러나 이것은 효과적입니다. 인증서가 실제 클라이언트가 제공되고 알 수 있도록 - 클라이언트는 공개 키 암호를 해독 할 수있는 개인 키와 데이터를 암호화하기 때문에
private static void ValidateRequestIsFromCertificateDomain()
{
RemoteEndpointMessageProperty endpointProperty = OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;
var claimSet = OperationContext.Current.ServiceSecurityContext.AuthorizationContext.ClaimSets[0] as X509CertificateClaimSet;
string domain = claimSet.X509Certificate.GetNameInfo(X509NameType.DnsName, false);
var resolvedAddress = System.Net.Dns.GetHostAddresses(domain);
if (resolvedAddress.Count() == 0 || endpointProperty.Address != resolvedAddress[0].ToString())
{
throw new SecurityException("Client address mismatch");
}
}
이 정말 필요하지 않습니다.
그러나 통합 요구 사항으로이 기능을 제공 한 경우이 기능이 유용 할 수 있습니다.