2012-05-09 3 views
1

서버 대 미래 날짜로 설정되어 최대 타임 스탬프의 유효 기간이 있습니까 :는 클라이언트가 우리는 다음과 같이 바인딩 우리의 사용자 정의에 대한 우리의 보안을 설정

var lSecurity = lCustomBinding.Elements.Find<TransportSecurityBindingElement>(); 
       lSecurity.LocalClientSettings.DetectReplays = false; 
       lSecurity.LocalServiceSettings.DetectReplays = false; 
       lSecurity.LocalClientSettings.TimestampValidityDuration = TimeSpan.FromDays(7); 
       lSecurity.LocalServiceSettings.TimestampValidityDuration = TimeSpan.FromDays(7); 
       lSecurity.LocalClientSettings.MaxClockSkew = TimeSpan.FromDays(7); 
       lSecurity.LocalServiceSettings.MaxClockSkew = TimeSpan.FromDays(7); 

이제 우리는 발견은 우리가 위의 테스트를하는 경우 클라이언트를 지금부터 7 일 후에 다시 설정하면 작동합니다. 그러나 앞으로 9 시간 이상 클라이언트를 설정하는 순간 예외가 발생합니다.

우리가 다른 스레드의 끝에 약간의 모호한 기준이었다 발견 된 유일한 :

http://social.msdn.microsoft.com/Forums/en/wcf/thread/7c3a7a7e-b9a5-4198-9a29-c6d4e408d36d

이 사람이 어떤 아이디어가 있습니까?

업데이트 : 예외가 추가되었습니다. 서버가 클라이언트 메시지를 거부하는 것처럼 보입니다.

System.ServiceModel.Security.MessageSecurityException occurred 
    Message=An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. 
    Source=mscorlib 
    StackTrace: 
    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.RenewTokenCore(TimeSpan timeout, SecurityToken tokenToBeRenewed) 
     at System.IdentityModel.Selectors.SecurityTokenProvider.RenewToken(TimeSpan timeout, SecurityToken tokenToBeRenewed) 
     at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.RenewKey(TimeSpan timeout) 
     at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.SecureOutgoingMessage(Message& message, TimeSpan timeout) 
     at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecurityDuplexSessionChannel.Send(Message message, TimeSpan timeout) 
     at System.ServiceModel.Channels.ClientReliableChannelBinder`1.DuplexClientReliableChannelBinder`1.OnSend(TDuplexChannel channel, Message message, TimeSpan timeout) 
     at System.ServiceModel.Channels.ReliableChannelBinder`1.Send(Message message, TimeSpan timeout, MaskingMode maskingMode) 
     at System.ServiceModel.Channels.SendReceiveReliableRequestor.OnRequest(Message request, TimeSpan timeout, Boolean last) 
     at System.ServiceModel.Channels.ReliableRequestor.Request(TimeSpan timeout) 
     at System.ServiceModel.Channels.ClientReliableSession.Open(TimeSpan timeout) 
     at System.ServiceModel.Channels.ClientReliableDuplexSessionChannel.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.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) 
     at CompuLoan.Maintenance.IMaintenanceService.IsLicensed(String pHardwareId, Boolean pUseLicense) 
     at CompuLoan.Maintenance.MaintenanceServiceClient.IsLicensed(String pHardwareId, Boolean pUseLicense) in C:\Development\compuloan\Source\CompuLoan\Service References\Maintenance\Reference.cs:line 5156 
     at CompuLoan.App.IsLicensed(Boolean pUseLicense) in C:\Development\compuloan\Source\CompuLoan\App.xaml.cs:line 365 
    InnerException: System.ServiceModel.FaultException 
     Message=The security context token is expired or is not valid. The message was not processed. 
     InnerException: 
+1

죄송합니다, Jano, 저는 정말로 기여할 것이 없습니다. 귀하의 질문과 링크가 나에게 상기시켜주었습니다. http://xkcd.com/979/ –

+0

두 번째 생각에서 아마 9 시간이 어떻게 든 당신의 시간대의 관계 UTC 또는 아마도 국제 날짜 행으로? –

+0

어쩌면 클라이언트가 서버 응답을 받았을 때 예외를 throw하고 다른 방법을 사용하지 않았을 수 있습니까? wcf lossing을 사용하여 확인하십시오. 전체 예외와 스택 추적을 게시하십시오. –

답변

1

이것은 타임 스탬프와 다른 세션 키의 만료입니다. 예를 들어 establishSecurityContext를 off로 설정하거나 CreateSecureConversationSecurity를 ​​사용하지 않으면이 예외가 발생하지 않아야합니다.

그렇지 않으면 InactivityTimeout, IssuedCookieLifetime, NegotiationTimeout, SessionKeyRenewalInterval 및 SessionKeyRolloverInterval과 같은 추가 값을 늘리십시오.

서버에서 WCF 추적을 설정하고 정확한 스택 추적을 보면 정확한 속성을 찾을 수 있습니다.

관련 문제