2012-01-13 1 views
6

보안이 설정된 WCF 서비스를 구성하려고합니다. LocalComputer \ Personal 인증서에 저장된 2 개의 인증서 (서버 및 클라이언트 측용)를 생성했습니다. 내 구성은 다음과 같습니다예외 : 클라이언트 인증서가 제공되지 않습니다.

서버 :

<netTcpBinding> 
    <binding name="defaultBinding"> 
     <security mode="Transport"> 
     <transport clientCredentialType="Certificate"/> 
     </security> 
    </binding> 
</netTcpBinding> 

<service name="..." behaviorConfiguration="serviceBehavior"> 
    <endpoint address="..." binding="netTcpBinding" bindingConfiguration="defaultBinding" contract="..."> 
     <identity> 
     <dns value="ClientSide"/> 
     </identity> 
    </endpoint> 
</service> 

<behavior name="serviceBehavior"> 
    <serviceCredentials> 
     <serviceCertificate storeLocation="LocalMachine" storeName="My" findValue="ServerSide" x509FindType="FindBySubjectName"/> 
     <clientCertificate> 
      <authentication certificateValidationMode="None" revocationMode="NoCheck"/> 
     </clientCertificate> 
    </serviceCredentials> 
<behavior> 

클라이언트 : 나는 예외를 얻고있다

<netTcpBinding> 
    <binding name="defaultBinding"> 
     <security mode="Transport"> 
     <transport clientCredentialType="Certificate"/> 
     </security> 
    </binding> 
</netTcpBinding> 

<endpoint name="..." binding="netTcpBinding" bindingConfiguration="defaultBinding" contract="..." 
      behaviorConfiguration="endpointBehavior"> 
    <identity> 
    <dns value="ServerSide"/> 
    </identity> 
</endpoint> 

<behavior name="endpointBehavior"> 
    <clientCredentials> 
     <serviceCertificate> 
      <authentication certificateValidationMode="None" revocationMode="NoCheck"/> 
     </serviceCertificate> 
     <clientCertificate storeLocation="LocalMachine" storeName="My" findValue="ClientSide" x509FindType="FindBySubjectName"/> 
    </clientCredentials> 
<behavior> 

: 클라이언트 인증서가 을 제공하지 않습니다. ClientCredentials에 클라이언트 인증서를 지정하십시오.

많은 자습서를 시도했지만 그 중 아무 것도 작동하지 않습니다. 어떠한 제안?

답변

6

답변은 실제로 예외에 있습니다. 클라이언트 인증서가 없습니다. 이

<clientCredentials> 
     <serviceCertificate> 
      <authentication certificateValidationMode="None" revocationMode="NoCheck"/> 
     </serviceCertificate> 
     <clientCertificate storeLocation="LocalMachine" storeName="My" findValue="ClientSide" x509FindType="FindBySubjectName"/> 
    </clientCredentials> 

와 클라이언트 인증서에 대한 서비스 인증서를 정의하지만 클라이언트

<system.serviceModel> 
    <behaviors> 
     <endpointBehaviors> 
     <behavior name="endpointBehavior"> 
      <clientCredentials> 
       <clientCertificate storeLocation="LocalMachine" storeName="My" findValue="ClientSide" x509FindType="FindBySubjectName" /> 
       <serviceCertificate> 
        <authentication certificateValidationMode="None" revocationMode="NoCheck" /> 
       </serviceCertificate> 
      </clientCredentials> 
     </behavior> 
     </endpointBehaviors> 
    </behaviors> 
</system.serviceModel> 

에 대한 클라이언트 인증서를 정의하는 당신이 실제로 했어야 이것은 적어도 당신의 The client certificate is not provided. Specify a client certificate in ClientCredentials 예외를 해결해야한다.