如何设置 SNI?

SNI 仅被 v2 配置/API 支持。

目前的实现中要求所有过滤器链中的过滤器 必须是相同的。在以后的发布中,这个约束将会放宽,我们将可以将SNI运用到完全不同的过滤器链中。 我们还可以将 域名匹配 运用到HTTP 连接管理中去选择不同的路由路线。

这是截至目前最常见的 SNI 使用场景。

以下是一个满足上述条件的 YAML 范例。

address:
  socket_address: { address: 127.0.0.1, port_value: 1234 }
filter_chains:
- filter_chain_match:
    sni_domains: "example.com"
  tls_context:
    common_tls_context:
      tls_certificates:
        - certificate_chain: { filename: "example_com_cert.pem" }
          private_key: { filename: "example_com_key.pem" }
  filters:
  - name: envoy.http_connection_manager
    config:
      route_config:
        virtual_hosts:
        - routes:
          - match: { prefix: "/" }
            route: { cluster: service_foo }
- filter_chain_match:
    sni_domains: "www.example.com"
  tls_context:
    common_tls_context:
      tls_certificates:
        - certificate_chain: { filename: "www_example_com_cert.pem" }
          private_key: { filename: "www_example_com_key.pem" }
  filters:
  - name: envoy.http_connection_manager
    config:
      route_config:
        virtual_hosts:
        - routes:
          - match: { prefix: "/" }
            route: { cluster: service_foo }
Copyright © 温玉 2021 | 浙ICP备2020032454号 all right reserved,powered by Gitbook该文件修订时间: 2021-03-27 13:36:20

results matching ""

    No results matching ""