在路由器和消息处理器之间配置 TLS

Edge for Private Cloud v. 4.17.09

默认情况下,路由器和消息处理器之间的 TLS 处于停用状态。

请按照以下步骤在路由器和消息处理器之间启用 TLS 加密:

  1. 确保路由器可以访问消息处理器上的端口 8082。
  2. 生成包含 TLS 证书和私钥的密钥库 JKS 文件。如需了解详情,请参阅为 Edge for On Premises 配置 TLS/SSL。
  3. 将密钥库 JKS 文件复制到 消息处理器 服务器上的 目录 ,例如 /opt/apigee/customer/application。
  4. 更改 JKS 文件的权限和所有权:
    > chown apigee:apigee /opt/apigee/customer/application/keystore.jks
    > chmod 600 /opt/apigee/customer/application/keystore.jks


    其中,keystore.jks 是密钥库文件的名称。
  5. 修改 /opt/apigee/customer/application/message-processor.properties 文件。 如果该文件不存在,请创建它。
  6. 在 message-processor.properties 文件中设置以下属性:
    conf_message-processor-communication_local.http.ssl=true
    conf/message-processor-communication.properties+local.http.port=8443
    conf/message-processor-communication.properties+local.http.ssl.keystore.type=jks
    conf/message-processor-communication.properties+local.http.ssl.keystore.path=/opt/apigee/customer/application/keyStore.jks
    conf/message-processor-communication.properties+local.http.ssl.keyalias=apigee-devtest
    # Enter the obfuscated keystore password below.
    conf/message-processor-communication.properties+local.http.ssl.keystore.password=OBF:obsPword


    其中,keyStore.jks 是您的密钥库文件,obsPword 是经过混淆处理的密钥库和 keyalias 密码。如需了解如何生成混淆密码,请参阅为 Edge for Private Cloud 配置 TLS/SSL。
  7. 确保 message-processor.properties 文件归“apigee”用户所有:
    > chown apigee:apigee /opt/apigee/customer/application/message-processor.properties
  8. 停止 Message-Processor 和 Router:
    /opt/apigee/apigee-service/bin/apigee-service edge-message-processor stop
    /opt/apigee/apigee-service/bin/apigee-service edge-router stop
  9. 在路由器上,删除 /opt/nginx/conf.d 中的所有文件:
    > rm -f /opt/nginx/conf.d/*
  10. 启动 Message-Processor 和 Router:
    /opt/apigee/apigee-service/bin/apigee-service edge-message-processor start
    /opt/apigee/apigee-service/bin/apigee-service edge-router start
  11. 对任何其他消息处理器重复上述步骤。

在路由器和消息处理器之间启用 TLS 后,消息处理器日志文件会包含以下 INFO 消息:

MessageProcessorHttpSkeletonFactory.configureSSL() : Instantiating Keystore of type: jks

此 INFO 语句确认 TLS 在路由器和消息处理器之间正常运行。

下表列出了 message-processor.properties 中的所有可用属性:

媒体资源

说明

conf_message-processor-communication_local.http.host=<localhost or IP address>

可选。要监听路由器连接的主机名。这将覆盖注册时配置的主机名。

conf/message-processor-communication.properties+local.http.port=8998

可选。用于监听路由器连接的端口。默认值为 8998。

conf_message-processor-communication_local.http.ssl=<false | true>

将此值设置为 true 可启用 TLS/SSL。默认值为 false。启用 TLS/SSL 后,您必须设置 local.http.ssl.keystore.path 和 local.http.ssl.keyalias。

conf/message-processor-communication.properties+local.http.ssl.keystore.path=

密钥库(JKS 或 PKCS12)的本地文件系统路径。当 local.http.ssl=true 时,此参数为必填。

conf/message-processor-communication.properties+local.http.ssl.keyalias=

密钥库中用于 TLS/SSL 连接的密钥别名。当 local.http.ssl=true 时为必需。

conf/message-processor-communication.properties+local.http.ssl.keyalias.password=

用于对密钥库中的密钥进行加密的密码。使用以下格式的混淆密码:OBF:xxxxxxxxxx

conf/message-processor-communication.properties+local.http.ssl.keystore.type=jks

密钥库类型。目前仅支持 JKS 和 PKCS12。默认值为 JKS。

conf/message-processor-communication.properties+local.http.ssl.keystore.password=

可选。密钥库的混淆密码。使用以下格式的经过混淆处理的密码:OBF:xxxxxxxxxx

conf_message-processor-communication_local.http.ssl.ciphers=<cipher1,cipher2>

可选。配置后,系统仅允许使用列出的密码。如果省略,则使用 JDK 支持的所有密码。