gpt4 book ai didi

wcf - 提供的 URI 方案 'https' 无效;预期 'http' 。参数名称 : via for HTTPS

转载 作者:行者123 更新时间:2023-12-04 21:47:51 29 4
gpt4 key购买 nike

以下是场景。

我们有 F5 负载均衡器,传入请求作为 HTTP 进入 F5 负载均衡器,然后它们被重定向到 WCF 服务服务器作为 HTTP。

我已经尝试了几乎所有可能的配置组合,但它不断给出两个不同的错误。例如,根据一些建议,我尝试将安全模式更改为“传输”,然后错误更改为:“无法为具有权限 'xxx.xxx.xxx.xxx:XXXX' 的 SSL/TLS 建立安全 channel .”

服务器配置:

<system.serviceModel>
<services>
<service behaviorConfiguration="NameofServiceBehaviour" name="NameOfServices">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpEndPointBinding" name="wsHttpEndPoint" contract="Name.IContractName" />
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="wsHttpEndPointBinding">
<security mode="None">
<!-- <transport clientCredentialType="Certificate" /> -->
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviourName">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<!-- <serviceCredentials>
<serviceCertificate findValue="CN=CertificateName" storeLocation="LocalMachine" />
</serviceCredentials> -->
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
</system.serviceModel>

客户端配置:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="wsHttpEndPoint">
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://URL.svc"
binding="wsHttpBinding" bindingConfiguration="wsHttpEndPoint"
contract="Name.IContractName" name="wsHttpEndPoint" />
</client>
</system.serviceModel>

问候,
纳西尔

最佳答案

在负载均衡器下,我遇到了这个问题,修复在客户端是这样的:

<system.serviceModel>        
<bindings>
<customBinding>
<binding name="MyBindingConfig">
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap11" writeEncoding="utf-8">
</textMessageEncoding>
<httpsTransport authenticationScheme="Anonymous" bypassProxyOnLocal="false" proxyAuthenticationScheme="Anonymous"/>
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://YOUR-END-POINTURL-WITH-HTTPS"
binding="customBinding" bindingConfiguration="MyBindingConfig"
contract="ServiceReference.YOURCONTRACT" name="TEST" />
</client>
</system.serviceModel>

您还可以看到,当您在 VisualStudio 上添加 webservice 引用并将 URL 与 HTTPS 一起放置时,它将自动在客户端端点子节点(客户端 app.config)上添加 URL,而没有 S 所以(HTTP 因为负载均衡器)然后您可以继续使用 HTTPS 更新它,就像我在上面的示例中所做的那样。
希望有帮助。

关于wcf - 提供的 URI 方案 'https' 无效;预期 'http' 。参数名称 : via for HTTPS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32206169/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com