自我签名 SSL 证书

SUSE Multi-Linux Manager 默认使用自我签名证书。在这种情况下,证书由 SUSE Multi-Linux Manager 创建和签名。此方法不使用独立证书颁发机构来保证证书的细节正确无误。第三方 CA 将会执行检查,以确保证书中包含的信息正确无误。

本节介绍如何在新安装或现有安装中创建或重新创建自我签名证书。

SSL 密钥和证书的主机名必须与其部署到的计算机的完全限定主机名相匹配。

CA certificates generated by older SUSE Multi-Linux Manager versions can miss the critical flag on the X509v3 Basic Constraints extension. Strict certificate validators, including Python 3.13 and later, reject such CA certificates and can report Basic Constraints of CA cert not marked critical. If your self-signed CA is affected, create a new CA and new server certificates, then deploy the new root CA to all clients. For more information about checking the CA certificate, see administration:ssl-certs-imported.adoc#ssl-certs-verify-ca-basic-constraints. For more information about replacing certificates and deploying the root CA to clients, see administration:ssl-certs-imported.adoc#ssl-certs-import-deploy-root-ca.

1. 重新创建现有的服务器证书

如果您的现有证书已失效或出于任何原因而不再正常工作,您可以从现有 CA 生成新的服务器证书。

过程:重新创建现有服务器证书
  1. 在 SUSE Multi-Linux Manager 容器主机的命令提示符处,重新生成服务器证书:

    mgrctl exec -ti -- 'rhn-ssl-tool --gen-server --dir="/root/ssl-build" --set-country="COUNTRY" \
    --set-state="STATE" --set-city="CITY" --set-org="ORGANIZATION" \
    --set-org-unit="ORGANIZATION UNIT" --set-email="name@example.com" \
    --set-hostname="susemanager.example.com" --set-cname="example.com"'

    Ensure that the set-cname parameter is the fully qualified domain name of your SUSE Multi-Linux Manager Server. You can use the set-cname parameter multiple times if you require multiple aliases.

The private key and the server certificate can be found inside the server container in the directory /root/ssl-build/susemanager/ as server.key and server.crt. The name of the last directory depends on the hostname used with --set-hostname option.

请通过更新容器的主机 Podman 机密来部署或导入新证书和密钥。有关如何导入刚才生成的证书的详细信息,请参见 administration:ssl-certs-imported.adoc#ssl-certs-import-replace

2. 创建新的 CA 证书和服务器证书

替换根 CA 时请小心。这可能会破坏服务器与客户端之间的信任链。如果发生这种情况,需要让某个管理用户登录到每个客户端并直接部署 CA。

过程:创建新证书
  1. 在 SUSE Multi-Linux Manager 容器主机的命令提示符处,将旧证书目录移到新位置:

    mgrctl exec -- mv /root/ssl-build /root/old-ssl-build
  2. 生成新的 CA 证书:

    mgrctl exec -ti -- 'rhn-ssl-tool --gen-ca --dir="/root/ssl-build" --set-country="COUNTRY" \
    --set-state="STATE" --set-city="CITY" --set-org="ORGANIZATION" \
    --set-org-unit="ORGANIZATION UNIT" --set-common-name="SUSE Manager CA Certificate" \
    --set-email="name@example.com"'
  3. 生成新的服务器证书:

    mgrctl exec -ti -- 'rhn-ssl-tool --gen-server --dir="/root/ssl-build" --set-country="COUNTRY" \
    --set-state="STATE" --set-city="CITY" --set-org="ORGANIZATION" \
    --set-org-unit="ORGANIZATION UNIT" --set-email="name@example.com" \
    --set-hostname="susemanager.example.top" --set-cname="example.com"'

    Ensure that the set-cname parameter is the fully qualified domain name of your SUSE Multi-Linux Manager Server. You can use the set-cname parameter multiple times if you require multiple aliases.

    还需要使用代理的主机名和 cname 为每个代理生成服务器证书。