为北向流量配置 TLS 1.3

本页面介绍了如何在 Apigee 路由器中为北向流量(客户端和路由器之间的流量)配置 TLS 1.3。

如需详细了解虚拟主机,请参阅虚拟主机

为路由器中所有基于 TLS 的虚拟主机启用 TLS 1.3

请按照以下步骤为路由器中所有基于 TLS 的虚拟主机启用 TLS 1.3:

  1. 在路由器上,在编辑器中打开以下属性文件。
    /opt/apigee/customer/application/router.properties

    如果该文件不存在,请创建一个。

  2. 将以下代码行添加到属性文件中:
    conf_load_balancing_load.balancing.driver.server.ssl.protocols=TLSv1 TLSv1.1 TLSv1.2 TLSv1.3

    添加您要支持的所有 TLS 协议。请注意,协议以空格分隔,并区分大小写。

  3. 保存文件。
  4. 确保文件归 Apigee 用户所有:
    chown apigee:apigee /opt/apigee/customer/application/router.properties
  5. 重启路由器:
    /opt/apigee/apigee-service/bin/apigee-service edge-router restart
  6. 在所有路由器节点上逐一重复上述步骤。

仅为特定虚拟主机启用 TLS 1.3

本部分介绍如何为特定虚拟主机启用 TLS 1.3。 如要启用 TLS 1.3,请在管理服务器节点上执行以下步骤:

  1. 在每个管理服务器节点上,修改文件 /opt/apigee/customer/application/management-server.properties 并添加以下行。 (如果该文件不存在,请创建一个)。
    conf_virtualhost_virtual.host.allowed.protocol.list=TLSv1,TLSv1.1,TLSv1.2,TLSv1.3

    对于此文件,协议以英文逗号分隔(并区分大小写)。

  2. 保存文件。
  3. 确保文件归 Apigee 用户所有:
    chown apigee:apigee /opt/apigee/customer/application/management-server.properties
  4. 重启管理服务器:
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart
  5. 对所有管理服务器节点逐一重复上述步骤。
  6. 使用以下属性创建(或更新现有)虚拟主机。请注意,协议以空格分隔,并区分大小写。
    "properties": {
        "property": [
          {
            "name": "ssl_protocols",
            "value": "TLSv1 TLSv1.1 TLSv1.2 TLSv1.3"
          }
        ]
    }

    具有此属性的示例 vhost 如下所示:

    {
      "hostAliases": [
        "api.myCompany,com",
      ],
      "interfaces": [],
      "listenOptions": [],
      "name": "secure",
      "port": "443",
      "retryOptions": [],
      "properties": {
        "property": [
          {
            "name": "ssl_protocols",
            "value": "TLSv1 TLSv1.1 TLSv1.2 TLSv1.3"
          }
        ]
      },
      "sSLInfo": {
        "ciphers": [],
        "clientAuthEnabled": "false",
        "enabled": "true",
        "ignoreValidationErrors": false,
        "keyAlias": "myCompanyKeyAlias",
        "keyStore": "ref://myCompanyKeystoreref",
        "protocols": []
      },
      "useBuiltInFreeTrialCert": false
    }

    测试 TLS 1.3

    如需测试 TLS 1.3,请输入以下命令:

    curl -v --tlsv1.3 "https://api.myCompany,com/testproxy"

    请注意,TLS 1.3 只能在支持此协议的客户端上进行测试。如果未启用 TLS 1.3,您将看到如下错误消息:

    sslv3 alert handshake failure