默认情况下,路由器和消息处理器之间的 TLS 处于停用状态。
如需在路由器和消息处理器之间启用 TLS 加密,请执行以下操作:
- 确保路由器可以访问消息处理器上的端口 8082。
- 生成包含 TLS 认证和私钥的密钥库 JKS 文件。如需了解详情,请参阅为边缘本地配置 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
的值必须与keytool
命令提供的-alias
值相同,如创建 JKS 文件部分所述。如需了解如何生成经过混淆处理的密码,请参阅为 Edge On Premises 配置 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 支持的所有加密方式。 |