2009-12-14 5 views
2

WCF 서비스를 사용하여 서로 통신하는 두 개의 웹 응용 프로그램에 문제가 있습니다. 이 내 시나리오 :DMZ에서 보안 WCF 서비스를 실행할 때의 문제

  • 웹 응용 프로그램 "A"
  • 은 웹 응용 프로그램 "B"가 DMZ의 서버에 배포 된 기업 인트라넷 및 도메인 "인트라넷"의 일부 서버에 배포, 인터넷 및 도메인 "익스트라 넷"의 일부로 노출
  • 방화벽은 두 도메인 사이에 있으며 트러스트 관계가 없습니다.
  • "A"는 wsHttpBinding을 사용하여 "B"의 일부 WCF 서비스를 호출합니다.
  • "B"의 WCF 서비스는 IIS에서 SSL로 전송 보안됩니다.

    ">

    <binding name="UsernameWithTransport"> 
        <security mode="TransportWithMessageCredential"> 
        <message clientCredentialType="UserName" 
         negotiateServiceCredential="false" /> 
        </security> 
    </binding> </wsHttpBinding> 
    

    " 모든 작품에 보인다 : 우리는 "A"

이 서버가 바인딩되는 구성을 인증하기 위해 사용자 이름 인증 동작을 사용하는

  • 프로덕션 환경과 같이 두 개의 도메인이있는 테스트 환경에서는 문제가 없습니다. 이후,


    System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. ---> System.ServiceModel.FaultException: An error occurred when verifying security for the message. 
    
    Server stack trace: 
    at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout) 
    at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout) 
    at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout) 
    at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout) 
    at System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout) 
    at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade) 
    at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) 
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 
    
    Exception rethrown at [0]: 
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
    

    먼저 나는 그것이 서버 간의 클럭 동기화의 문제라고 생각 : 그럼에도 불구하고 프로덕션 환경에서 내가 못생긴 오류를 "A"인 "B"를 호출 할 때마다 얻을 테스트 환경에서 10 분의 차이로 시계를 변경하여 동일한 예외를 재현 할 수 있습니다. 유감스럽게도 이것은 프로덕션 서버가 동기화되는 데 문제가없는 것 같습니다.

    모든 정보를 제공해드립니다.

  • 답변

    0

    마지막으로 우리는 문제를 싫어할 수 있으며 권한이 부족하여 "C : \ Windows \ Temp"에서 응용 프로그램 풀 ID를 쓸 수 없었습니다.

    MessageSecurityException은 일반적인 종류의 예외이며 많은 문제에서 발생할 수 있습니다. 실제 예외를 알기 위해 serviceDebug 동작을 서비스 구성에 추가하고 오류에 대한 자세한 정보를 보려면 eventviewer를 살펴 봅니다.


    <serviceBehaviors> 
    <behavior name="ServiceBehavior"> 
    <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" /> 
    <serviceDebug includeExceptionDetailInFaults="true" /> 
    <serviceSecurityAudit auditLogLocation="Application" 
        suppressAuditFailure="false" 
        serviceAuthorizationAuditLevel="None" 
        messageAuthenticationAuditLevel="SuccessOrFailure" /> 
    </behavior> 
    


    어쨌든 감사 :

    이 디버그 설정입니다!

    관련 문제