默认情况下,路由器和消息处理器之间的 TLS 处于停用状态。
如需在路由器和消息处理器之间启用 TLS 加密,请执行以下操作:
- 确保路由器可以访问消息处理器上的端口 8082。
- 生成包含 TLS 证书和私钥的密钥库 JKS 文件。如需了解详情, 请参阅为 Edge 本地部署配置 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 是经过 混淆处理的密钥库和 keyalias 密码。注意:
的值必须与conf/message-processor-communication.properties+local.http.ssl.keyalias=apigee-devtest
-alias选项提供的值相同,如keytool命令的 创建 JKS 文件部分末尾所述。如需了解如何生成经过混淆处理的密码,请参阅 为 Edge 本地部署配置 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 支持的所有 加密算法。 |