当前位置: 代码迷 >> ASP.NET >> |zyciis| WCF远程服务器https SSL 怎么进行配置,多谢 
  详细解决方案

|zyciis| WCF远程服务器https SSL 怎么进行配置,多谢 

热度:1673   发布时间:2013-02-25 00:00:00.0
|zyciis| WCF远程服务器https SSL 如何进行配置,谢谢 急
如,我是用VS2008SP1进行开发的,
宿主为IIS类型
我就直接新建了一个WCF WEB项目
然后就写完我的程序
再建立一个测试的Web Applocation项目进行测试
一切OK
-------------------------
然后我就把我的WCF项目放到服务器
然后配置好了SSL证书,和我本要测试用的客户端证书
最后运行提示:

提供的 URI 方案“https”无效;应为“http”。

服务器 Web.config
XML code
<?xml version="1.0"?><configuration>  <appSettings>  </appSettings>  <system.web>    <authentication mode="Windows"/>    <compilation debug="true"/>  </system.web>  <system.serviceModel>    <services>      <service behaviorConfiguration="CrmWCF.CRMBehavior" name="CrmWCF.CRM">        <endpoint address="" binding="wsHttpBinding" contract="CrmWCF.CRM">          <identity>            <dns value="localhost"/>          </identity>        </endpoint>        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>      </service>    </services>    <behaviors>      <serviceBehaviors>        <behavior name="CrmWCF.CRMBehavior">          <serviceMetadata httpGetEnabled="true"/>          <serviceDebug includeExceptionDetailInFaults="false"/>        </behavior>      </serviceBehaviors>    </behaviors>  </system.serviceModel></configuration>

客户端Web.config
XML code
 
  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_CRM" closeTimeout="00:01:00" openTimeout="00:01:00"  receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
        transactionFlow="false" hostNameComparisonMode="StrongWildcard"
        maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
        textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
          maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00"
          enabled="false" />
          <security mode="Message">
            <transport clientCredentialType="Windows" proxyCredentialType="None"
            realm="" />
            <message clientCredentialType="Windows" negotiateServiceCredential="true"
            algorithmSuite="Default" establishSecurityContext="true" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="https://192.168.30.252/CRM.svc" binding="wsHttpBinding"
      bindingConfiguration="WSHttpBinding_CRM" contract="CRM.CRM" name="WSHttpBinding_CRM">
  相关解决方案