Https证书错误,IIS上的WCF服务

Https证书错误,IIS上的WCF服务,wcf,web-services,iis,https,x509certificate,Wcf,Web Services,Iis,Https,X509certificate,我想组织客户端和WCF服务之间的安全连接。必须确保客户端可以信任服务 我已经在本地机器上为受信任的Root用户和个人存储创建了两个证书。我可以在证书加载项中看到正确的证书路径。 证书公用名为localhost 我已经在IIS上添加了https的绑定 我有以下配置的服务 行为 <behavior name="AgencyTrustedServiceBehavior"> <dataContractSerializer maxItemsInObjectGraph=

我想组织客户端和WCF服务之间的安全连接。必须确保客户端可以信任服务

我已经在本地机器上为受信任的Root用户和个人存储创建了两个证书。我可以在证书加载项中看到正确的证书路径。 证书公用名为localhost

我已经在IIS上添加了https的绑定

我有以下配置的服务

行为

    <behavior name="AgencyTrustedServiceBehavior">
      <dataContractSerializer maxItemsInObjectGraph="10000000" />
      <serviceMetadata httpsGetEnabled="true" policyVersion="Policy15" />
      <serviceDebug includeExceptionDetailInFaults="true" />

      <serviceCredentials>
        <clientCertificate>
          <authentication certificateValidationMode="None"  />
        </clientCertificate>

        <serviceCertificate findValue="localhost" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />

      </serviceCredentials>
    </behavior>

有什么问题吗?

客户端正在访问的URL是:

"http://localhost/IISTest/AuthService"

应该是


"https://localhost/IISTest/AuthService“

首先,您不应该使用https吗?我使用https。我已经为IIS添加了https绑定(使用此证书),我尝试访问地址我已经解决了这个问题-WCF测试客户端自动使用而不是。当我添加了带有地址的服务时,它就工作了。
  <wsHttpBinding>
    <binding name="InternetServiceBinding" closeTimeout="00:10:00"
          openTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="true"
          maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
          messageEncoding="Mtom">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
        maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <security mode="Transport">
        <transport clientCredentialType="None">
          <extendedProtectionPolicy policyEnforcement="Never" />
        </transport>
      </security>
    </binding>
  </wsHttpBinding>
  <service behaviorConfiguration="AgencyTrustedServiceBehavior" name="Megatec.MasterTourService.AuthService">
    <endpoint address="Anonymous" 
              binding="wsHttpBinding" 
              bindingConfiguration="InternetServiceBinding" 
              name="Megatec.MasterTourService.Contracts.IAuthServiceAnonymous" 
              contract="Megatec.MasterTourService.Contracts.IAuthService">
    </endpoint>
  </service>
There was no endpoint listening at http://localhost/IISTest/AuthService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.    The remote server returned an error: (404) Not Found.

HTTP GET Error    URI: http://localhost/IISTest/AuthService.svc    The document at the url http://localhost/IISTest/AuthService.svc was not recognized as a known document type.The error message from each known type may help you fix the problem:
- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.
- Report from 'DISCO Document' is 'There was an error downloading 'https://dev4-10.megatec.ru/IISTest/AuthService.svc?disco'.'.  
- The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.  
- The remote certificate is invalid according to the validation procedure.
- Report from 'http://localhost/IISTest/AuthService.svc' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.
- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.