Istio 不会通过 TLS 发起路由到外部 HTTPs 服务。
我有一个包含两个容器的 pod: - 应用程序 - ISTIO 代理
应用程序调用位于https://someurl.somedomain.com/v1/some-service 的外部第三方 API
应用程序通过调用http://someurl.somedomain.com/v1/some-service向该服务发送 HTTP 请求- 注意它是 HTTP 而不是 HTTPs。
然后我在 ISTIO 中配置了以下内容:
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: someservice-vs
spec:
hosts:
- someurl.somedomain.com
http:
- match:
- port: 80
route:
- destination:
host: someurl.somedomain.com
port:
number: 443
timeout: 40s
retries:
attempts: 10
perTryTimeout: 4s
retryOn: gateway-error,connect-failure,refused-stream,retriable-4xx,5xx
Run Code Online (Sandbox Code Playgroud)
apiVersion: …Run Code Online (Sandbox Code Playgroud) 我正在寻找 dotnet core WCF wsHttpBinding 解决方法。
我知道 .net core WCF 实现目前不支持 wsHttpBinding (请参阅此处的支持矩阵https://github.com/dotnet/wcf/blob/master/release-notes/SupportedFeatures-v2.1.0.md)
我正在与似乎仅支持 wsHttpBinding 的遗留第三方服务集成。我们的技术堆栈是 .net core,因此我无法恢复到 .net 框架的完整版本或 mono 变体。
问题是是否可以通过自定义绑定使用该服务?我希望有一种解决方法,可能无法完全发挥作用,但至少允许我使用该服务。
var cBinding = new CustomBinding();
var textBindingElement = new TextMessageEncodingBindingElement()
{
MessageVersion = MessageVersion.Soap12WSAddressing10
};
cBinding.Elements.Add(textBindingElement);
var httpBindingElement =
new HttpsTransportBindingElement
{
AllowCookies = true, MaxBufferSize = int.MaxValue, MaxReceivedMessageSize = int.MaxValue,
};
cBinding.Elements.Add(httpBindingElement);
var myEndpoint = new EndpointAddress("https://..../Service.svc/wss");
using (var myChannelFactory = new ChannelFactory<ISearch>(cBinding, myEndpoint))
{
myChannelFactory.Credentials.UserName.UserName = "...";
myChannelFactory.Credentials.UserName.Password = "...";
ISearch client = …Run Code Online (Sandbox Code Playgroud)