默认情况下,路由器和邮件处理器之间的 TLS 处于停用状态。
要在路由器和邮件处理器之间启用 TLS 加密,请执行以下操作:
- 确保路由器可以访问消息处理器上的端口 8082。
- 生成包含 TLS 证书和私钥的密钥库 JKS 文件。如需了解详情, 请参阅为 Edge On 配置 TLS/SSL 场所。
- 将密钥库 JKS 文件复制到消息处理器服务器上的某个目录中,例如
      名称:/opt/apigee/customer/application。
- 更改 JKS 文件的权限和所有权:
      chown apigee:apigee /opt/apigee/customer/application/keystore.jks chmod 600 /opt/apigee/customer/application/keystore.jks其中, keystore.jks是您的密钥库文件的名称。
- 修改 /opt/apigee/customer/application/message-processor.properties文件。 如果该文件不存在,请创建该文件。
- 在 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 是您的密钥库文件。 经过混淆处理的密钥库和密钥别名密码。注意: conf/message-processor-communication.properties+local.http.ssl.keyalias=apigee-devtest -alias选项为keytool命令,如本节末尾所述 创建一个 JKS 文件。请参阅 为边缘本地部署配置 TLS/SSL: 了解如何生成经过混淆处理的密码。 
- 确保 message-processor.properties文件归“apigee”所有 用户:chown apigee:apigee /opt/apigee/customer/application/message-processor.properties 
- 停止消息处理器和路由器:
      /opt/apigee/apigee-service/bin/apigee-service edge-message-processor stop /opt/apigee/apigee-service/bin/apigee-service edge-router stop
- 在路由器上,删除 /opt/nginx/conf.d目录中的所有文件:rm -f /opt/nginx/conf.d/* 
- 启动消息处理器和路由器:
      /opt/apigee/apigee-service/bin/apigee-service edge-message-processor start /opt/apigee/apigee-service/bin/apigee-service edge-router start
- 对每个消息处理器重复此过程。
在路由器和消息处理器之间启用 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:obsPword | 
| 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:obsPword | 
| conf_message-processor-communication_local. http.ssl.ciphers=cipher1,cipher2 | 可选。配置后,系统仅允许使用列出的加密算法。如果省略,请使用全部 以及 JDK 支持的加密套件。 |