Could not establish secure channel for SSL/TLS with authority '*'

前端 未结 9 1616
感情败类
感情败类 2020-12-14 17:59

I must consume a PHP webservice which has a SSL certificate. My .net 3.5 Class library references the webservice with \'Add Service references\' in Visualstudio 2010 (WCF ri

相关标签:
9条回答
  • 2020-12-14 18:49

    Ensure you run Visual Studio as an administrator.

    0 讨论(0)
  • 2020-12-14 18:50

    This was exact the problem I was facing. At some other article I got a hint to change the configuration. For me this works:

    <bindings>
      <basicHttpBinding>
        <binding name="xxxBinding">
          <security mode="Transport">
            <transport clientCredentialType="Certificate"/>
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    
    0 讨论(0)
  • 2020-12-14 18:52

    This error can occur for lots of reasons, and the last time, I solved it by modifying the Reference.svcmap file, and changing how the WSDL file is referenced.

    Throwing exception:

    <MetadataSource Address="C:\Users\Me\Repo\Service.wsdl" Protocol="file" SourceId="1" />
    <MetadataFile FileName="Service.wsdl" ... SourceUrl="file:///C:/Users/Me/Repo/Service.wsdl" />
    

    Working fine:

    <MetadataSource Address="https://server.domain/path/Service.wsdl" Protocol="http" SourceId="1" />
    <MetadataFile FileName="Service.wsdl" ... SourceUrl="https://server.domain/path/Service.wsdl" />
    

    This seems weird, but I have reproduced it. This was in a console application on .NET 4.5 and 4.7, as well as a .NET WebAPI site on 4.7.

    0 讨论(0)
提交回复
热议问题