Dell Unity:如何将 Unisphere 自签名 SSL 证书替换为本地证书颁发机构提供的签名证书。(用户可纠正)
Summary: 如何将 Unity Unisphere 自签名 SSL 证书替换为本地证书颁发机构提供的签名证书。
Instructions
- 在 Unity 上生成私钥
使用以下命令生成长度为 2048 位的 RSA 私钥。-out 选项指定私钥的文件名。
service@unknown spa:~/user# openssl genrsa -out unitycert.pk 2048 Generating RSA private key, 2048 bit long modulus ............................+++ .........................................................................................+++ e is 65537 (0x10001)
- 在 Unity 上请求 CSR
使用私钥创建 CSR。而 -new option 表示新请求, -key 指定私钥文件,以及 -out 定义 CSR 文件名。
service@unknown spa:~/user# openssl req -new -key unitycert.pk -out unitycert.csr \ -subj '/C=IE/ST=Cork/L=Ovens/O=DellEMC/CN=name.example.com' \ -reqexts SAN -config <(cat /etc/ssl/openssl.cnf <(printf "[SAN]\nsubjectAltName=DNS:name.example.com,IP:192.0.2.1"))
"/C=IE/ST=Cork/L=Ovens/O=DellEMC/CN=name.example.com" and "DNS:name.example.com" are examples and must be changed per your environment (further details below). The IP option and IP Address for the SAN value is also optional and can be omitted. The variables in the -subj field stand for: C = Country Code ST = State or Province L = City or Locality O = Organization CN = Common Name (The FQDN you want to secure in this case the Unity) SAN = Subject Alternative Name (IP and DNS for the entity you want to secure in this case the Unity)
- 获取由 Windows CA 服务器或 OpenSSL CA 服务器或其他 CA 服务器签署的 CSR。
使用下面的方法 1 或方法 2 将 CSR 传送到 CA 服务器:
- 方法 1:使用“打印 CSR”
cat“命令,将其复制并粘贴到本地记事本,然后另存为: unitycert.csr.
service@unknown spa:~/user# cat unitycert.csr -----BEGIN CERTIFICATE REQUEST----- MIICljCCAX4CAQAwUTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk1BMREwDwYDVQQH DAhTYXJhc290YTEPMA0GA1UECgwGTXlDdXN0MREwDwYDVQQDDAgxMC4wLjAuMTCC ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOBxqufN1Vpm0hq5K5UU0ocd teL2hJr5T1WIOmwQreX4nIdHIxVoWmyepmT7IZJIrQZQc8GuFDRx5qZ/cwlxoup7 <..snip..> lJc/79vxTfrWWNnSF95C+wer2LB93VLov8MSQqPZfl0LPb4NRU/XaE4l9Vh5DYl4 /FmwHXsifwV5f1TUkvhC8YTwn5frWQjruz+ItZ3z9DetQX0OXYXMcaPX5Qp6aU5m dsXFHDDiaVbOofJN9z6OPOsWUhn0ZwEpnW8q/+V72MdBIfiwEjoQqZZKh4w1l0/7 uElP8BfS7vH/i87OCqHJM0g/O3IndF+p5wYzmhrDPg/f3belQVQvKs7Z -----END CERTIFICATE REQUEST-----
- 方法 2:下载 CSR by SCP.
使用 FileZilla 或 WinSCP 等第三方工具连接到 Unity 管理 IP(用户名:服务)。协议必须更改为 SCP。
- 从 CA 服务器收到签名证书后,将其上传到 Unity 并将其名称保存为 unitycert.crt(对应于 unitycert.PK)。现在,Unity 上将有两个文件:unitycert.crt 和 unitycert.pk。
5.使用 svc_custom_cert 用于安装证书的命令:
service@unknown spa:~/user# svc_custom_cert unitycert Successfully installed custom certificate files. Restarting web server ... Sun May 22 05:37:48 2016:7645\0x7f44ba3e27c0:32:Module CIC/1.1.10.6 loaded
提醒:步骤 5 成功后,删除 unitycert。Unity 阵列中的 crt、unitycert.pk 和 unitycert.csr。否则,如果您将它们保存在 /cores/service/user 中,可能会导致安全漏洞问题。
提醒:尝试安装新证书时可能会发生错误:
service@SPB spb:~/user# svc_custom_cert unitycert ERROR: Certificate </tmp/cert.MIbZ4L/unitycert.crt> is invalid
在安装证书之前,证书必须进行 base64 编码。可以使用 Windows 工具“certutil”进行转换:
Certutil -v -encode unitycert.crt unity64cert.crt Input Length = 1520 Output Length = 2148 CertUtil: -encode command completed successfully.
也可以使用 OpenSSL 命令在 Unity 系统上转换它:
openssl x509 -in <certificate file> -inform DER -outform PEM -out unitycert.crt
转换后,按照上面的说明进行安装。请参阅知识库文章 19728:Dell EMC Unity:如何导入本地证书颁发机构签名的 SSL 证书(用户可纠正), 了解更多详细信息。
如果证书已采用 PEM 格式,但扩展.cer,您可以运行:openssl x509 -inform PEM -in <certificate file> -outform PEM -out unitycert.crt
Additional Information
这适用于通配符证书:
除了 Base 64 编码证书部分之外,上传包含 PKCS7 编码证书或其他内容的证书文件有时可能会导致 SP 死机和其他问题。在这种情况下,证书可以缩减为仅“Base 64 编码证书”部分。
svc_custom_cert 脚本,以不允许使用不受支持的算法签名的证书。
CST 中支持的唯一签名算法:
SHA1_RSA
SHA256_RSA
SHA384_RSA
SHA512_RSA