문제

기본 인증을 사용하여 제 3 자 WCF 서비스를 소비하고 싶지만 SNI를 사용해야합니다.다음 예제 (실제 엔드 포인트 재료 마이너스)를 함께 해킹하여 설정하고 내가 얻는 오류를 보여주는 것입니다.

WCF에 대해 거의 알지 못하고 SNI에 대해서는 아무 것도 알지 못할 것입니다.

config

<endpoint 
 address="https://their.server.com/theirservice.svc"
 binding="basicHttpBinding"  
  bindingConfiguration="BasicHttpBinding_ISyncFramework2"
  contract="ISyncFramework" name="BasicHttpBinding_ISyncFramework2">
 </endpoint>

       <basicHttpBinding>
         <binding name="BasicHttpBinding_ISyncFramework2" closeTimeout="00:01:00"
        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
       allowCookies="false" bypassProxyOnLocal="false" 
      hostNameComparisonMode="StrongWildcard"
      maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
      useDefaultWebProxy="true">
           <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
               maxBytesPerRead="4096" maxNameTableCharCount="16384" />
           <security mode="Transport">
             <transport clientCredentialType="Basic" proxyCredentialType="None"
                 realm="" />
           </security>
         </binding>
       </basicHttpBinding>
.

코드 :

            var service = new SyncFrameworkClient();
            service.ClientCredentials.UserName.UserName = "username";
            service.ClientCredentials.UserName.Password = "thepassword";

            service.method() // fails!
.

메소드 호출은 다음과 같습니다.

요청한 서비스, 'https://their.server.com/theirservice.svc'를 활성화 할 수 없습니다.자세한 정보는 서버의 진단 추적 로그를 참조하십시오.

서버 추적

Server stack trace: 
   at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException, ChannelBinding channelBinding)
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, 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)
.
도움이 되었습니까?

해결책

해당 오류는 일반적으로 클라이언트 측 문제가 아닌 서비스 측 문제입니다.SNI는 SSL 핸드 쉐이킹을 개선하는 서버 기술이며 Microsoft 스택은 릴리스되지 않은 IIS 8 버전에서만 지원됩니다.제 3자가 자신의 SNI / SSL 스택을 압 연지하지 않는 한, WCF 서비스가 요구할 것처럼 보이지 않는 것처럼 보입니다.

실제 예외에서 이 블로그 게시물 는 문제의 원인이 될 것입니다.구성 및 코드 스 니펫은 SSL 및 기본 HTTP 인증을 사용하여 BasichTtpBinding에 대해 올바르게 보입니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top