2009-04-02 4 views
3

이 질문과 동일한 문제 일 수 있습니다 : WCF Proxy 확실하지 않습니다 ...HTTPS 끝점이있는 WCF 서비스에 대한 클라이언트 프록시를 생성하려면 어떻게해야합니까?

전송 보안을 사용하도록 HTTPS 서비스가 구성되어 있으며 Windows 자격 증명이 필요합니다. 서비스는 내부적으로 (즉, 인트라넷 내에서만) 액세스됩니다. 구성은 다음과 같습니다.

<configuration> 
    <system.serviceModel> 
    <services> 
     <service name="WCFTest.CalculatorService" behaviorConfiguration="WCFTest.CalculatorBehavior"> 
     <host> 
      <baseAddresses> 
      <add baseAddress = "https://localhost:8000/WCFTest/CalculatorService/" /> 
      </baseAddresses> 
     </host> 
     <endpoint address ="basicHttpEP" binding="basicHttpBinding" contract="WCFTest.ICalculatorService" bindingConfiguration="basicHttpBindingConfig"/>  
     <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="basicHttpBindingConfig"> 
      <security mode="Transport"> 
      <transport clientCredentialType = "Windows"/> 
      </security> 
     </binding> 
     </basicHttpBinding> 
    </bindings> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="WCFTest.CalculatorBehavior">   
      <serviceAuthorization impersonateCallerForAllOperations="false" principalPermissionMode="UseWindowsGroups" /> 
      <serviceCredentials > 
      <windowsAuthentication allowAnonymousLogons="false" includeWindowsGroups="true" /> 
      </serviceCredentials> 
      <serviceMetadata httpsGetEnabled="True"/> 
      <serviceDebug includeExceptionDetailInFaults="False" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 
</configuration> 

서비스를 실행할 때 IE에서 서비스를 볼 수 없습니다. "이 페이지를 표시 할 수 없습니다."오류가 발생합니다.

There was an error downloading ' https://localhost:8000/WCFTest/CalculatorService/ '. There was an error downloading ' https://localhost:8000/WCFTest/CalculatorService/ '. The underlying connection was closed: An unexpected error occurred on a send. Authentication failed because the remote party has closed the transport stream. Metadata contains a reference that cannot be resolved: ' https://localhost:8000/WCFTest/CalculatorService/ '. An error occurred while making the HTTP request to https://localhost:8000/WCFTest/CalculatorService/ . This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server. The underlying connection was closed: An unexpected error occurred on a send. Authentication failed because the remote party has closed the transport stream. If the service is defined in the current solution, try building the solution and adding the service reference again.

내가 여기에 몇 가지 기본적인 기초를 누락 생각 : 나는 시도하고 "서비스 참조를 추가"마법사를 통해 VS2008의 클라이언트를 작성하는 경우이 오류를 얻을. 일부 인증서를 설정해야합니까? 또는 NetTcpBinding을 사용할 때처럼 보이는대로 작동해야합니까?

감사

+0

클라이언트 구성을 게시 할 수 있습니까? –

+0

내가 수락하는 Windows 그룹을 제한하는 방법을 모르겠습니다. Windows 그룹과 Active Directory 그룹간에 차이가 있습니까? – ng5000

+0

아직 클라이언트가 없습니다. 비록 내가 "서비스 참조 추가"를 할 수는 있지만 나를 위해 설정을 만들 것입니다. – ng5000

답변

-1

변경

<endpoint address ="basicHttpEP" binding="basicHttpBinding" contract="WCFTest.ICalculatorService" bindingConfiguration="basicHttpBindingConfig"/> 

<endpoint address ="basicHttpEP" binding="basicHttpsBinding" contract="WCFTest.ICalculatorService" bindingConfiguration="basicHttpBindingConfig"/> 
+0

늘어나는만큼 [basicHttpsBinding] (http://msdn.microsoft.com/en-us/library/system.servicemodel.basichttpsbinding (v = vs.110) .aspx)은 .NET 4.5에서만 사용할 수 있습니다. – BladeWise

0

ng5000,

는 (아마 IIS) 여기에 또 다른 문제가있을 수 있습니다처럼 보인다. 전송 레벨 보안에 문제가 있습니까? 나는 또한 당신이 WCF 물건을 확인하기 전에 IE에서 웹 주소를 얻을 수 있는지 확인합니다. 보안 탭에서 올바르지 않은 IIS 설정처럼 들립니다.

여전히 문제가있는 경우 전송 수준 보안을 사용하여 프록시를 구축하고 다시 돌아가서 두 구성을 수준 Windows 보안 전송으로 변경하고 어떤 일이 발생하는지 확인하십시오.

-Bryan

+0

저는 IIS를 사용하지 않고 있습니다. 저는 작은 콘솔 앱으로 자체 호스팅하고 있습니다. – ng5000

0
... 
<security defaultAlgorithmSuite="Default" authenticationMode="IssuedTokenOverTransport" 
        requireDerivedKeys="false" securityHeaderLayout="Strict" includeTimestamp="true" 
        keyEntropyMode="CombinedEntropy" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"> 
        <issuedTokenParameters keyType="SymmetricKey" tokenType="" /> 
... 

에 여기 내 해결 방법입니다. 나는 설정 파일 위에 있고 "IssuedTokenOverTransport"에서 "UserNameOverTransport"로 authenticationMode를 변경했습니다. 제 환경에서 문제가 해결되었습니다.

관련 문제