小编vik*_*ikp的帖子

如何在 ISTIO 中配置 TLS 源?

Istio 不会通过 TLS 发起路由到外部 HTTPs 服务。

我有一个包含两个容器的 pod: - 应用程序 - ISTIO 代理

应用程序调用位于https://someurl.somedomain.com/v1/some-service 的外部第三方 API

应用程序通过调用http://someurl.somedomain.com/v1/some-service向该服务发送 HTTP 请求- 注意它是 HTTP 而不是 HTTPs。

然后我在 ISTIO 中配置了以下内容:

  • 将 HTTP 流量路由到端口 443 的虚拟服务:
---
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)
  • 允许流量流出的服务入口。如您所见,我们指定服务在网格外部,我们打开了 443 和 80,它们都使用 HTTP,但 443 配置为 TLS 发起。
apiVersion: …
Run Code Online (Sandbox Code Playgroud)

kubernetes istio envoyproxy mtls

5
推荐指数
1
解决办法
1119
查看次数

.NET Core 中的 wsHttpBinding 解决方法

我正在寻找 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)

.net c# wcf wshttpbinding .net-core

2
推荐指数
1
解决办法
7409
查看次数

标签 统计

.net ×1

.net-core ×1

c# ×1

envoyproxy ×1

istio ×1

kubernetes ×1

mtls ×1

wcf ×1

wshttpbinding ×1