保护 Web Studio 部署(可选)

当您将 Web Studio 与 Delivery Controller™ 一起安装时,安装程序会创建一个自签名证书,该证书绑定到当前服务器的 443 端口。Web Studio 和 Delivery Controller 将使用该证书作为 TLS 证书。从其他计算机访问时,您可能无法访问 Web Studio,或者在 Web Studio 登录屏幕中看到错误。

如果您想从其他计算机访问 Web Studio,可以执行以下操作:

  1. 从交付控制器中导出该自签名证书。

    导出自签名证书

    • 对于 导出私钥,选择 否,不导出私钥

    • 对于 导出文件格式,选择 DER 编码的二进制 X.509 (.CER)

  2. 转到您要访问 Web Studio 的计算机,然后安装证书。

    安装证书

    • 对于 存储位置,选择 本地计算机

如果您选择将 Web Studio 安装在远离 Delivery Controller 的专用服务器上,则需要执行两项任务:

  • 任务 1:分别从 Web Studio 服务器和交付控制器导出证书。

  • 任务 2:在您要访问 Web Studio 的计算机上安装这两个证书。

注意:

作为最佳实践,我们建议您使用外部公共信任证书或企业 CA 颁发的证书来保护您的 Web Studio 部署。

使用外部公共信任证书

您可以使用以下三种方法之一将外部公共信任证书导入到 Web Studio 服务器中:

  • 安装 PFX 文件

    1. 双击 PFX 文件。

    2. 对于存储位置,选择本地计算机

      证书导入向导

    3. 如果需要,输入密码。

      密钥保护

    4. 对于证书存储,选择个人

      证书存储

  • 使用“管理计算机证书”控制台

    1. 打开“管理计算机证书”控制台,然后转到个人 > 证书 > 所有任务 > 导入

      管理计算机证书控制台

    2. 选择 PFX 文件,如果需要,输入密码。

  • Use PowerShell.

     Import-PfxCertificate -Password $(ConvertTo-SecureString -String "123456" -AsPlainText -Force) -CertStoreLocation Cert:\LocalMachine\My\ -FilePath .\Desktop\certificate.pfx
     <!--NeedCopy-->
    

然后将证书绑定到 443 端口。您可以在安装或升级之前或之后执行此操作。如果为 443 端口配置了证书绑定,安装程序不会执行任何操作。有关详细信息,请参阅安装或升级之前

使用企业 CA 的证书

在开始之前,请确保您的域中已部署企业证书颁发机构 (CA) 服务器。

要请求证书,请执行以下步骤:

  1. 在服务器上,打开管理计算机证书控制台

  2. 转到个人 > 证书 > 所有任务 > 请求新证书

    请求新证书

  3. 转到证书注册,选择 Web 服务器,然后单击警告消息以填写必要信息。

    证书注册

  4. 选择公用名作为主题名称类型,并输入您的 FQDN 或 DNS。此外,输入备用名称。

    注意:

    如果您需要通配符证书,您可以为主题名称输入 CN=*.bvttree.local,为备用 DNS 名称输入 *.bvttree.local and bvttree.local

    证书属性

证书在个人 > 证书下可用。

个人 > 证书

然后将证书绑定到 443 端口。您可以在安装或升级之前或之后执行此操作。如果已为 443 端口配置了证书绑定,则安装程序不会执行任何操作。

在安装或升级之前

要将证书绑定到 443 端口,请执行以下步骤(前提是尚未为 443 配置证书绑定,并且服务器上已启用 IIS):

  1. 以管理员身份登录 Web Studio 服务器。

  2. 打开 IIS 管理器,导航到 站点 > 默认网站 > 绑定

  3. 站点绑定 中,单击 添加

    站点绑定 2

  4. 添加站点绑定 中,将类型设置为 https,端口设置为 443,选择从 CA 请求的 SSL 证书,然后单击 确定

    添加站点绑定

在您完成 Web Studio 的安装后,Web Studio 和 Delivery Controller 将自动配置,以使用该证书来确保连接的安全性。

或者,您可以使用 PowerShell 更改证书。

$certSName = 'CN=whpdevddc0.bvttree.local'  # The subject name of the certificate
$certificate = Get-ChildItem -Path Cert:\LocalMachine\My\ | ? {$_.Subject -eq $certSName}
netsh http add sslcert ipport=0.0.0.0:443 certhash=$($certificate.Thumbprint) certstorename=My appid="$($(New-Guid).ToString("B"))"
<!--NeedCopy-->

在安装或升级之后

转到 Web Studio 服务器并使用 IIS 管理器更改证书。 或者,您可以使用 PowerShell 更改证书。

$certSName = 'CN=whpdevddc0.bvttree.local' # The Enterprise CA certificate subject.
$certificate = Get-ChildItem -Path Cert:\LocalMachine\My\ | ? {$_.Subject -eq $certSName}
netsh http update sslcert ipport=0.0.0.0:443 certhash=$($certificate.Thumbprint)
<!--NeedCopy-->

使用新的自签名证书

您可以生成新的自签名证书并用它替换现有证书。请执行以下步骤:

  1. 以管理员身份登录到 Web Studio 服务器。

  2. 打开 IIS 管理器,导航到 服务器证书,然后在 操作 窗格中选择 创建自签名证书

    服务器证书(/zh-cn/citrix-virtual-apps-desktops/2407/media/server-certificates.png)

  3. 创建自签名证书 中,输入证书名称,然后单击 确定。自签名证书随即创建。

    创建自签名证书(/zh-cn/citrix-virtual-apps-desktops/2407/media/create-self-signed-certificate.png)

  4. 导航到 站点 > 默认网站,在 操作 窗格中选择 绑定,选择 https 条目,然后选择 编辑

    站点绑定(/zh-cn/citrix-virtual-apps-desktops/2407/media/site-bindings.png)

  5. 编辑站点绑定 中,从列表中选择证书,然后单击 确定

    编辑站点绑定(/zh-cn/citrix-virtual-apps-desktops/2407/media/edit-site-binding.png)

这样就完成了证书的更改。

或者,您可以使用 PowerShell 更改证书。

$certSubject = "CN=WHPBVTDEVDDC2.BVTTREE.LOCAL" # The FQDN of the server.
$frindlyName = "Self-Signed-3"
$expireYears = 5

## new self-signed certificate under LocalMachine\My
$certificate = New-SelfSignedCertificate -Subject $certSubject -CertStoreLocation "Cert:\LocalMachine\My\" -KeyExportPolicy Exportable -KeySpec Signature -KeyLength 2048 -KeyAlgorithm RSA -HashAlgorithm SHA256 -FriendlyName $frindlyName -NotAfter $([System.DateTime]::Now.AddYears($expireYears))
Remove-Item -Path $Env:TEMP\tempCertificate.cer -Force -ErrorAction SilentlyContinue

## Import this certificate into LocalMachine\Root to let this OS trust this certificate
Export-Certificate -Type CERT -Force -Cert $certificate -FilePath $Env:TEMP\tempCertificate.cer -NoClobber
Import-Certificate -FilePath $Env:TEMP\tempCertificate.cer -CertStoreLocation "Cert:\LocalMachine\Root\"

## Update bind the 0.0.0.0:443 with this certificate
Invoke-Command -ScriptBlock { Param ($param1) netsh http update sslcert ipport=0.0.0.0:443 certhash=$param1 } -ArgumentList @($certificate.Thumbprint)
<!--NeedCopy-->
保护 Web Studio 部署(可选)