WCF是否支持SNI(服务器名称指示)

WCF是否支持SNI(服务器名称指示),wcf,wcf-binding,sni,Wcf,Wcf Binding,Sni,我想使用使用基本身份验证的第三方WCF服务,但我还需要使用SNI。我将下面的示例(减去真正的端点内容)拼凑在一起,以显示我的设置和错误 非常感谢您的帮助,因为我对WCF知之甚少,对SNI一无所知 配置 调用方法失败,原因是: 请求的服务,'https://their.server.com/theirservice.svc“无法激活。有关详细信息,请参阅服务器的诊断跟踪日志 服务器跟踪 该错误通常是服务端问题,而不是客户端问题。SNI是一种用于改进SSL握手的服务器技术,在Microsoft堆栈中

我想使用使用基本身份验证的第三方WCF服务,但我还需要使用SNI。我将下面的示例(减去真正的端点内容)拼凑在一起,以显示我的设置和错误

非常感谢您的帮助,因为我对WCF知之甚少,对SNI一无所知

配置 调用方法失败,原因是:

请求的服务,'https://their.server.com/theirservice.svc“无法激活。有关详细信息,请参阅服务器的诊断跟踪日志

服务器跟踪
该错误通常是服务端问题,而不是客户端问题。SNI是一种用于改进SSL握手的服务器技术,在Microsoft堆栈中是一个新版本。除非第三方推出自己的SNI/SSL堆栈,否则他们的WCF服务似乎不太可能需要它

在您遇到的实际异常情况中,似乎有一些类似的情况可能是问题的原因。您的配置和代码片段使用SSL和基本HTTP身份验证查找basicHttpBinding

<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!
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)