ThingWorx Flow > 安装和配置 > 配置 ThingWorx Flow > 重新生成自签名证书
重新生成自签名证书
运行以下命令以在 <ThingWorx_Flow_Install_Location>/SSL 目录中重新生成 orchestration.csrorchestration.crt 文件:
1. 备份 <ThingWorx_Flow_Install_Location>/SSL 目录。
2. 删除 <ThingWorx_Flow_Install_Location>/SSL 目录下的所有文件。
3. 使用 openssl 实用程序运行以下命令以生成证书:
<openssl_cmd> req -nodes -sha256 -newkey rsa:2048 -config <openssl_conf> -keyout "<ThingWorx_Flow_Install_Location>/SSL/orchestration.key" -subj "/C=<C>/O=<O>/OU=<OU>/CN=<CN>" -out "<ThingWorx_Flow_Install_Location>/SSL/orchestration.csr"
<openssl_cmd> x509 -req -days 365 -sha256 -in "<ThingWorx_Flow_Install_Location>/SSL/orchestration.csr" -signkey "<ThingWorx_Flow_Install_Location>/SSL/orchestration.key" -out "<ThingWorx_Flow_Install_Location>/SSL/orchestration.crt"
,其中
<C> - 国家/地区名称 (2 个字母组成的代码)
<O> - 组织名称 (例如公司)
<OU> - 组织单位名称 (例如部门)
<CN> - 公共名称 (例如服务器 FQDN) 完全限定域名 (例如 win-f3ai9djq75j)
<openssl_cmd> - Windows:运行 cd C:/opscode/chef/embedded/bin/opensslcd C:/cinc-project/cinc/embedded/bin、键入 openssl,然后运行以上命令。
Linux:键入 openssl,然后运行以上命令。
<openssl_conf>—Windows: C:/opscode/chef/embedded/ssl/openssl.cnfC:/cinc-project/cinc/embedded/ssl/openssl.cnf
Linux:/etc/pki/tls/openssl.cnf
例如:
Windows - C:/opscode/chef/embedded/bin/openssl req -nodes -sha256 -newkey rsa:2048 -config C:/opscode/chef/embedded/ssl/openssl.cnf -keyout "C:\orchestration.key" -subj "/C=US/O=PTC/OU=IT Department/CN=WIN-F3AI9DJQ75J" -out "C:\orchestration.csr"
Windows - C:/opscode/chef/embedded/bin/openssl x509 -req -days 365 -sha256 -in "C:\PROGRA~1\twx\THINGW~2/SSL/orchestration.csr" -signkey "C:\orchestration.key" -out "C:\orchestration.crt"
4. 对于 ThingWorx Flow 9.1.0 及更高版本,ThingWorx Flow 9.0.3 及更高版本:
a. <ThingWorx_Flow_Install_Location>/SSL 文件夹下,创建 nginx-keyfile 文件,并为加密私钥创建新密码。
b. 使用 openssl 实用程序运行以下命令来加密 nginx 私钥:
<openssl_cmd> rsa -aes256 -passout pass:<与 nginx-keyfile 中定义的密码相同> -in "<ThingWorx_Flow_Install_Location>/SSL/orchestration.key" -out "<ThingWorx_Flow_Install_Location>/SSL/orchestration_enc.key"
c. 删除 orchestration.key,然后将 orchestration_enc.key 重命名为 orchestration.key
5. (仅限 Linux) 设置以下权限:
sudo chown flowuser:flowuser <ThingWorx_Flow_Install_Location>\SSL\orchestration.crt,其中 flowuser 为运行 ThingWorx Flow 安装程序的用户。
sudo chown flowuser:flowuser <ThingWorx_Flow_Install_Location>\SSL\orchestration.key
其中,flowuser 是运行 ThingWorx Flow 安装程序的用户。
sudo chcon -t httpd_sys_content_t <ThingWorx_Flow_Install_Location>\SSL\orchestration.crt
sudo chcon -t httpd_sys_content_t <ThingWorx_Flow_Install_Location>\SSL\orchestration.key
对于 ThingWorx Flow 9.1.0 和 ThingWorx Flow 9.03 及更高版本:
sudo chown flowuser:flowuser <ThingWorx_Flow_Install_Location>/SSL/nginx-keyfile
其中,flowuser 是运行 ThingWorx Flow 安装程序的用户。
sudo chcon -t httpd_sys_content_t <ThingWorx_Flow_Install_Location>/SSL/nginx-keyfile
6. 更改位于 <ThingWorx Flow 安装目录>\SSL 文件夹中的 extra.crt 文件,然后用新的自签名证书内容替换第一个证书的内容。
7. 重新启动 RabbitMQThingWorx-FlowNginxThingWorx-Foundation 服务。
这对您有帮助吗?