使用具有 vSphere Authentication Proxy 的自定义证书包含多个步骤。首先,生成 CSR 并将其发送给 CA 进行签名。然后,将已签名证书和密钥文件放在 vSphere Authentication Proxy 能够访问的位置。

默认情况下,vSphere Authentication Proxy 会在首次引导期间生成 CSR 并要求 VMCA 签署此 CSR。vSphere Authentication Proxy 将使用此证书向 vCenter Server 进行注册。将自定义证书添加到 vCenter Server 后,即可在环境中使用这些证书。

过程

  1. 为 vSphere Authentication Proxy 生成 CSR。
    1. 创建配置文件 /var/lib/vmware/vmcam/ssl/vmcam.cfg,如下例所示。
      [ req ]
      distinguished_name = req_distinguished_name
      encrypt_key = no
      prompt = no
      string_mask = nombstr
      req_extensions = v3_req
      [ v3_req ]
      basicConstraints = CA:false
      keyUsage = nonRepudiation, digitalSignature, keyEncipherment
      subjectAltName = DNS:dns.static-1.csl.vmware.com
      [ req_distinguished_name ]
      countryName = IE
      stateOrProvinceName = Cork
      localityName = Cork
      0.organizationName = VMware
      organizationalUnitName = vTSU
      commonName = test-cam-1.test1.vmware.com
    2. 运行 openssl 以生成 CSR 文件和密钥文件,同时传入配置文件。
      openssl req -new -nodes -out vmcam.csr -newkey rsa:2048 -keyout /var/lib/vmware/vmcam/ssl/rui.key -config /var/lib/vmware/vmcam/ssl/vmcam.cfg
  2. 备份 rui.crt 证书和 rui.key 文件,它们存储在以下位置。
    操作系统 位置
    vCenter Server Appliance /var/lib/vmware/vmcam/ssl/rui.crt
    vCenter Server Windows C:\ProgramData\VMware\vCenterServer\data\vmcamd\ssl\rui.crt
  3. 取消注册 vSphere Authentication Proxy。
    1. 转到 camregister 脚本所在的目录。
      操作系统 命令
      vCenter Server Appliance /usr/lib/vmware-vmcam/bin
      vCenter Server Windows C:\Program Files\VMware\vCenter Server\vmcamd
    2. 运行下列命令。
      camregister --unregister -a VC_address -u user
      user 必须是对 vCenter Server 拥有管理员权限的 vCenter Single Sign-On 用户。
  4. 停止 vSphere Authentication Proxy 服务。
    工具 步骤
    vCenter Server Appliance 管理界面 (VAMI)
    1. 在 Web 浏览器中,转至 vCenter Server Appliance 管理界面,https:// appliance-IP-address-or-FQDN:5480。
    2. 以 root 用户身份登录。

      默认 root 密码是您在部署 vCenter Server Appliance 时设置的密码。

    3. 单击服务,然后单击 VMware vSphere Authentication Proxy 服务。
    4. 单击停止
    vSphere Web Client
    1. 选择系统管理,然后在部署下单击系统配置
    2. 单击服务,单击 VMware vSphere Authentication Proxy 服务,然后单击红色的停止服务图标。
    CLI
    service-control --stop vmcam
    
  5. 将现有 rui.crt 证书和 rui.key 文件替换为从 CA 收到的文件。
  6. 重新启动 vSphere Authentication Proxy 服务。
  7. 使用新证书和密钥向 vCenter Server 明确地重新注册 vSphere Authentication Proxy。
    camregister --register -a VC_address -u user -c full_path_to_rui.crt -k full_path_to_rui.key