2011-04-27 4 views
2


wcf 서비스를 만들었으며이를 클라이언트 응용 프로그램에서 성공적으로 참조 할 수있었습니다. 하지만 X509 인증서를 구현할 때 문제가 발생합니다.WCF 프록시 오류 X509 인증서 사용

1) x509 인증서를 사용하도록 서비스를 변경하면 mex 엔드 포인트가 브라우저에 표시되지 않으므로 프록시를 만들 수 없습니다. 따라서이 경우 서비스가 보호되고 mex 엔드 포인트가 노출되지 않은 상태에서 클라이언트 앱의 서비스를 어떻게 참조해야합니까?

2) 메시지 및 전송 보안을 인증서로 사용할 수 있습니까? basicHttpBinding에 대해이 시나리오가 작동합니까? basicHttpBinding은 인증서를 통해 메시지 보안을 가질 수 없다고 들었습니다.

이와 관련하여 도움을 주시면 대단히 감사하겠습니다.

다음은 서비스의 내 서비스 모델입니다.

<system.serviceModel> 
<client>  
    <endpoint behaviorConfiguration="" 
    binding="basicHttpBinding" 
     bindingConfiguration="WCFServiceX509Binding" 
    contract="WCFService.Contract.Service.IWCFServiceContract" 
     name="WCFServiceClientEndPoint" />  
</client> 
<bindings> 
    <basicHttpBinding> 
    <binding name="WCFServiceX509Binding" maxBufferSize="6553600" 
     maxBufferPoolSize="52428800" maxReceivedMessageSize="6553600"> 
     <security mode="TransportWithMessageCredential"> 
     <transport clientCredentialType="Certificate" /> 
     <message clientCredentialType="Certificate" /> 
     </security> 
    </binding>   
    </basicHttpBinding> 
</bindings> 
<services> 
    <service behaviorConfiguration="ServiceBehavior" 
    name="WCFService.Model.WCFServiceModel"> 
    <endpoint 
    address="" 
    binding="basicHttpBinding" 
    bindingConfiguration="WCFServiceX509Binding" 
     name="WCFServiceBasicHttpEndPoint" 
    contract="WCFService.Contract.Service.IWCFServiceContract"> 
     <identity> 
      <certificateReference findValue="WCFUADOCServer" /> 
     </identity> 
    </endpoint> 
    </service> 
</services> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="ServiceBehavior"> 
     <serviceMetadata httpGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
     <serviceCredentials /> 
    </behavior> 
    </serviceBehaviors> 
    <endpointBehaviors> 
    <behavior name="ClientCertificateBehavior"> 
     <clientCredentials> 
     <clientCertificate findValue="WCFUADOCServer" 
        x509FindType="FindBySubjectName" 
        storeLocation="LocalMachine" 
        storeName="TrustedPeople" /> 
     </clientCredentials> 
    </behavior> 
    </endpointBehaviors> 
</behaviors> 

정말 고마워요, 찬드.

답변

0
  1. 멕시코 엔드 포인트는 인증서에 의존하지 않습니다. 구성에 따라 mex 끝점을 전혀 노출시키지 않고 HTTP를 통해 WSDL 도움말 페이지를 계속 사용할 수 있어야합니다.
  2. 무엇을 하시겠습니까? 보안은 약간 high level term in this case입니다. 보안 전송 채널을 사용할 수 있으며 인증을 위해 메시지로 전송 된 인증서를 사용할 수 있습니다 (필자는이 조합을 한번도 시도하지 않았습니다). 시나리오는 BasicHttpBinding 이상에서 작동합니다. 나는 그 자체로 놀랐다. 그러나 BasicHttpBinding은 실제적으로 완전한 상호 인증서 비대칭 메시지 보안을 지원한다. (IIS에서 호스팅하는 경우) 중 하나 IIS management console으로 구성 또는 assign certificate to port by netsh (자체 호스팅) -

당신이 HTTPS를 사용해야합니다 전송 보안과 서비스를 노출합니다. 서비스를 실행하는 계정은 인증서의 개인 키 (you must correctly set up ACL)에 액세스 할 수 있어야합니다.

인증서로 클라이언트를 인증하려면 service credentials을 설정해야합니다. 당신이 인증서 저장소에 배치 자체 서명 된 인증서를 사용하는 경우 적어도 이것을 사용한다 : 또한 custom certificate validator을 정의 할 수 있습니다

<serviceCredentials> 
    <clientCertificate> 
    <authentication certificateValidationMode="PeerTrust" /> 
    </clientCertificate> 
</serviceCredentials> 

. 종단점을 사용하려면 오히려 dns ID를 사용하십시오.

클라이언트의 경우 서비스 인증서에 대한 PeerTrust 유효성 검사 모드도 사용하십시오.

+0

와우는 빨랐습니다 ... 굉장한 참고 자료. 그렇습니다. 보안 수준은 매우 높습니다. 기본적으로 이것은 매우 민감한 정보를 전달하므로 전송 및 메시지 보안을 모두 가져야했습니다. – Chandanan

+0

나는 당신에게 제안 된 모든 것을하려고 노력할 것이고, 다시 당신에게 돌아갈 것이다. 답장을 보내 주셔서 감사합니다. 안부, 찬드. – Chandanan

+0

"상위 수준 용어"에 대한 추가 링크를 게시하는 것을 잊어 버렸습니다. 나는 내 대답을 수정했다. –