安装、链接和更新证书
要安装证书,请参阅添加或更新证书密钥对。
链接证书
许多服务器证书由多个分层证书颁发机构 (CA) 签名,这意味着证书形成了如下所示的链:
有时,中间 CA 被拆分为主中间 CA 证书和辅助中间 CA 证书。然后,证书形成一个链,如下所示:
客户端计算机通常在其本地证书存储中包含根 CA 证书,但不包含一个或多个中间 CA 证书。ADC 设备必须向客户端发送一个或多个中间 CA 证书。
注意: 设备不得向客户端发送根 CA 证书。公钥基础结构 (PKI) 信任关系模型要求通过带外方法在客户端上安装根 CA 证书。例如,证书包含在操作系统或 Web 浏览器中。客户端将忽略设备发送的根 CA 证书。
有时,标准 Web 浏览器无法识别为受信任 CA 的中间 CA 会颁发服务器证书。在这种情况下,必须将一个或多个 CA 证书与服务器自己的证书一起发送到客户端。否则,浏览器将终止 SSL 会话,因为它无法对服务器证书进行身份验证。
视频链接到 如何链接中间颁发机构证书。
请参阅以下部分以添加服务器证书和中间证书:
- 手动证书链接
- 自动证书链接
- 创建证书链
手动证书链接
注意: Citrix ADC FIPS 平台和群集设置中不支持此功能。
现在,您可以将服务器证书和最多九个中间证书分组到一个文件中,而不是添加和链接单个证书。您可以在添加证书密钥对时指定文件的名称。在执行此操作之前,请确保满足以下必备条件。
- 文件中的证书按以下顺序排列:
- 服务器证书(必须是文件中的第一个证书)
- 或者,服务器密钥
- 中间证书 1 (ic1)
- 中间证书 2 (ic2)
- 中间证书 3 (ic3) 等 注意:为每个中间证书创建中间证书文件,名称为“<certificatebundlename>.pem_ic< n>”,其中 n 介于 1 和 9 之间。例如,bundle.pem_ic1,其中 bundle 是证书集的名称,ic1 是证书集中的第一个中间证书。
- 捆绑选项处于选中状态。
- 文件中存在的中间证书不超过九个。
将对文件进行解析,并标识服务器证书、中间证书和服务器密钥(如果存在)。首先,添加服务器证书和密钥。然后,按照将中间证书添加到文件中的顺序添加并相应地链接。
如果存在以下任一条件,则报告错误:
- 设备上存在一个中间证书的证书文件。
- 密钥放在文件中的服务器证书之前。
- 中间证书放置在服务器证书之前。
- 中间证书的放置顺序不与其创建相同。
- 文件中没有证书。
- 证书不是正确的 PEM 格式。
- 文件中的中间证书数量超过 9 个。
使用 CLI 添加证书集
在命令提示符下,键入以下命令以创建证书集并验证配置:
add ssl certKey <certkeyName> -cert <string> -key <string> -bundle (YES | NO)
show ssl
show ssl certlink
在以下示例中,证书集(bundle.pem)包含以下文件:
链接到 bundle_ic1 的服务器证书 (bundle)
链接到 bundle_ic2 的第一个中间证书 (bundle_ic1)
链接到 bundle_ic3 的第二个中间证书 (bundle_ic2)
第三个中间证书 (bundle_ic3)
add ssl certKey bundletest -cert bundle9.pem -key bundle9.pem -bundle yes
sh ssl certkey
1) Name: ns-server-certificate
Cert Path: ns-server.cert
Key Path: ns-server.key
Format: PEM
Status: Valid, Days to expiration:5733
Certificate Expiry Monitor: ENABLED
Expiry Notification period: 30 days
Certificate Type: Server Certificate
Version: 3
Serial Number: 01
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=US,ST=California,L=San Jose,O=Citrix ANG,OU=NS Internal,CN=default OULLFT
Validity
Not Before: Apr 21 15:56:16 2016 GMT
Not After : Mar 3 06:30:56 2032 GMT
Subject: C=US,ST=California,L=San Jose,O=Citrix ANG,OU=NS Internal,CN=default OULLFT
Public Key Algorithm: rsaEncryption
Public Key size: 2048
2) Name: servercert
Cert Path: complete/server/server_rsa_1024.pem
Key Path: complete/server/server_rsa_1024.ky
Format: PEM
Status: Valid, Days to expiration:7150
Certificate Expiry Monitor: ENABLED
Expiry Notification period: 30 days
Certificate Type: Server Certificate
Version: 3
Serial Number: 1F
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=IN,ST=KAR,O=Citrix R&D Pvt Ltd,CN=Citrix
Validity
Not Before: Sep 2 09:54:07 2008 GMT
Not After : Jan 19 09:54:07 2036 GMT
Subject: C=IN,ST=KAR,O=Citrix Pvt Ltd,CN=Citrix
Public Key Algorithm: rsaEncryption
Public Key size: 1024
3) Name: bundletest
Cert Path: bundle9.pem
Key Path: bundle9.pem
Format: PEM
Status: Valid, Days to expiration:3078
Certificate Expiry Monitor: ENABLED
Expiry Notification period: 30 days
Certificate Type: Server Certificate
Version: 3
Serial Number: 01
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=IN,ST=ka,O=sslteam,CN=ICA9
Validity
Not Before: Nov 28 06:43:11 2014 GMT
Not After : Nov 25 06:43:11 2024 GMT
Subject: C=IN,ST=ka,O=sslteam,CN=Server9
Public Key Algorithm: rsaEncryption
Public Key size: 2048
4) Name: bundletest_ic1
Cert Path: bundle9.pem_ic1
Format: PEM
Status: Valid, Days to expiration:3078
Certificate Expiry Monitor: ENABLED
Expiry Notification period: 30 days
Certificate Type: Intermediate CA
Version: 3
Serial Number: 01
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=IN,ST=ka,O=sslteam,CN=ICA8
Validity
Not Before: Nov 28 06:42:56 2014 GMT
Not After : Nov 25 06:42:56 2024 GMT
Subject: C=IN,ST=ka,O=sslteam,CN=ICA9
Public Key Algorithm: rsaEncryption
Public Key size: 2048
5) Name: bundletest_ic2
Cert Path: bundle9.pem_ic2
Format: PEM
Status: Valid, Days to expiration:3078
Certificate Expiry Monitor: ENABLED
Expiry Notification period: 30 days
Certificate Type: Intermediate CA
Version: 3
Serial Number: 01
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=IN,ST=ka,O=sslteam,CN=ICA7
Validity
Not Before: Nov 28 06:42:55 2014 GMT
Not After : Nov 25 06:42:55 2024 GMT
Subject: C=IN,ST=ka,O=sslteam,CN=ICA8
Public Key Algorithm: rsaEncryption
Public Key size: 2048
6) Name: bundletest_ic3
Cert Path: bundle9.pem_ic3
Format: PEM
Status: Valid, Days to expiration:3078
Certificate Expiry Monitor: ENABLED
Expiry Notification period: 30 days
Certificate Type: Intermediate CA
Version: 3
Serial Number: 01
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=IN,ST=ka,O=sslteam,CN=ICA6
Validity
Not Before: Nov 28 06:42:53 2014 GMT
Not After : Nov 25 06:42:53 2024 GMT
Subject: C=IN,ST=ka,O=sslteam,CN=ICA7
Public Key Algorithm: rsaEncryption
Public Key size: 2048
7) Name: bundletest_ic4
Cert Path: bundle9.pem_ic4
Format: PEM
Status: Valid, Days to expiration:3078
Certificate Expiry Monitor: ENABLED
Expiry Notification period: 30 days
Certificate Type: Intermediate CA
Version: 3
Serial Number: 01
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=IN,ST=ka,O=sslteam,CN=ICA5
Validity
Not Before: Nov 28 06:42:51 2014 GMT
Not After : Nov 25 06:42:51 2024 GMT
Subject: C=IN,ST=ka,O=sslteam,CN=ICA6
Public Key Algorithm: rsaEncryption
Public Key size: 2048
8) Name: bundletest_ic5
Cert Path: bundle9.pem_ic5
Format: PEM
Status: Valid, Days to expiration:3078
Certificate Expiry Monitor: ENABLED
Expiry Notification period: 30 days
Certificate Type: Intermediate CA
Version: 3
Serial Number: 01
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=IN,ST=ka,O=sslteam,CN=ICA4
Validity
Not Before: Nov 28 06:42:50 2014 GMT
Not After : Nov 25 06:42:50 2024 GMT
Subject: C=IN,ST=ka,O=sslteam,CN=ICA5
Public Key Algorithm: rsaEncryption
Public Key size: 2048
9) Name: bundletest_ic6
Cert Path: bundle9.pem_ic6
Format: PEM
Status: Valid, Days to expiration:3078
Certificate Expiry Monitor: ENABLED
Expiry Notification period: 30 days
Certificate Type: Intermediate CA
Version: 3
Serial Number: 01
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=IN,ST=ka,O=sslteam,CN=ICA3
Validity
Not Before: Nov 28 06:42:48 2014 GMT
Not After : Nov 25 06:42:48 2024 GMT
Subject: C=IN,ST=ka,O=sslteam,CN=ICA4
Public Key Algorithm: rsaEncryption
Public Key size: 2048
10) Name: bundletest_ic7
Cert Path: bundle9.pem_ic7
Format: PEM
Status: Valid, Days to expiration:3078
Certificate Expiry Monitor: ENABLED
Expiry Notification period: 30 days
Certificate Type: Intermediate CA
Version: 3
Serial Number: 01
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=IN,ST=ka,O=sslteam,CN=ICA2
Validity
Not Before: Nov 28 06:42:46 2014 GMT
Not After : Nov 25 06:42:46 2024 GMT
Subject: C=IN,ST=ka,O=sslteam,CN=ICA3
Public Key Algorithm: rsaEncryption
Public Key size: 2048
11) Name: bundletest_ic8
Cert Path: bundle9.pem_ic8
Format: PEM
Status: Valid, Days to expiration:3078
Certificate Expiry Monitor: ENABLED
Expiry Notification period: 30 days
Certificate Type: Intermediate CA
Version: 3
Serial Number: 01
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=IN,ST=ka,O=sslteam,CN=ICA1
Validity
Not Before: Nov 28 06:42:45 2014 GMT
Not After : Nov 25 06:42:45 2024 GMT
Subject: C=IN,ST=ka,O=sslteam,CN=ICA2
Public Key Algorithm: rsaEncryption
Public Key size: 2048
12) Name: bundletest_ic9
Cert Path: bundle9.pem_ic9
Format: PEM
Status: Valid, Days to expiration:3078
Certificate Expiry Monitor: ENABLED
Expiry Notification period: 30 days
Certificate Type: Intermediate CA
Version: 3
Serial Number: 01
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=IN,ST=ka,O=sslteam,CN=RootCA4096
Validity
Not Before: Nov 28 06:42:43 2014 GMT
Not After : Nov 25 06:42:43 2024 GMT
Subject: C=IN,ST=ka,O=sslteam,CN=ICA1
Public Key Algorithm: rsaEncryption
Public Key size: 2048
Done
sh ssl certlink
1) Cert Name: bundletest CA Cert Name: bundletest_ic1
2) Cert Name: bundletest_ic1 CA Cert Name: bundletest_ic2
3) Cert Name: bundletest_ic2 CA Cert Name: bundletest_ic3
4) Cert Name: bundletest_ic3 CA Cert Name: bundletest_ic4
5) Cert Name: bundletest_ic4 CA Cert Name: bundletest_ic5
6) Cert Name: bundletest_ic5 CA Cert Name: bundletest_ic6
7) Cert Name: bundletest_ic6 CA Cert Name: bundletest_ic7
8) Cert Name: bundletest_ic7 CA Cert Name: bundletest_ic8
9) Cert Name: bundletest_ic8 CA Cert Name: bundletest_ic9
Done
使用 GUI 添加证书集
- 导航到流量管理>SSL>证书>CA 证书。
- 在详细信息窗格中,单击 Install(安装)。
- 在“安 装证书对话框中,键入详细信息,如证书和密钥文件名,然后选择证书捆绑。
- 单击安装,然后单击关闭。
自动证书链接
注意: 此功能可从版本 13.0 版本 47.x 中获得。
您不再需要手动将证书链接到其颁发者到根证书。如果设备上存在中间 CA 证书和根证书,则可以单击最终用户证书中的链接按钮。
将显示潜在链。
单击 链接证书 以链接所有证书。
创建证书链
您可以创建证书链,而不是使用一组证书(单个文件)。链将服务器证书链接到其颁发机构(中间 CA)。此方法要求中间 CA 证书文件安装在 ADC 设备上,并且客户端应用程序必须信任该链中的其中一个证书。例如,将证书-中间体-A 链接到证书-中间体-B,其中 Cert-中间体-B 链接到 Cert-中间体-C,后者是客户端应用程序信任的证书。
注意: 设备支持在发送到客户端的证书链中最多发送 10 个证书(一个服务器证书和九个 CA 证书)。
使用 CLI 创建证书链
在命令提示符处,键入以下命令以创建证书链并验证配置。(对链中的每个新链接重复第一个命令。)
link ssl certkey <certKeyName> <linkCertKeyName>
show ssl certlink
示例:
link ssl certkey siteAcertkey CAcertkey
Done
show ssl certlink
linked certificate:
1) Cert Name: siteAcertkey CA Cert Name: CAcertkey
Done
通过使用 GUI 创建证书链
- 导航到流量管理>SSL>证书。
- 选择一个服务器证书,然后在操 作”列表中选择链接,然后指定 CA 证书名称。
更新现有服务器证书
要手动更改现有服务器证书,必须执行以下步骤:
- 从虚拟服务器中解除旧证书的绑定。
- 从设备中删除证书。
- 将新证书添加到设备。
- 将新证书绑定到虚拟服务器。
为了减少替换证书密钥对时的停机时间,您可以更新现有证书。如果要将证书替换为颁发给其他域的证书,则必须在更新证书之前禁用域检查。
要接收有关即将到期的证书的通知,您可以启用到期监视器。
从配置的 SSL 虚拟服务器或服务中删除或解除绑定证书时,虚拟服务器或服务将变为非活动状态。在绑定新的有效证书后,它们将处于活动状态。为了减少停机时间,您可以使用更新功能替换绑定到 SSL 虚拟服务器或 SSL 服务的证书密钥对。
有关如何更新 Citrix ADC 设备上的 SSL 证书的概述图。
视频链接到 如何更新现有证书。
使用 CLI 更新现有的证书密钥对
在命令提示符下,键入以下命令以更新现有证书密钥对并验证配置:
update ssl certkey <certkeyName> -cert <string> -key <string>
show ssl certKey <certkeyName>
示例:
update ssl certkey siteAcertkey -cert /nsconfig/ssl/cert.pem -key /nsconfig/ssl/pkey.pem
Done
show ssl certkey siteAcertkey
Name: siteAcertkey Status: Valid
Version: 3
Serial Number: 02
Signature Algorithm: md5WithRSAEncryption
Issuer: /C=US/ST=CA/L=Santa Clara/O=siteA/OU=Tech
Validity
Not Before: Nov 11 14:58:18 2001 GMT
Not After: Aug 7 14:58:18 2004 GMT
Subject: /C=US/ST-CA/L=San Jose/O=CA/OU=Security
Public Key Algorithm: rsaEncryption
Public Key size: 2048
Done
使用 GUI 更新现有的证书密钥对
-
导航到 流量管理 > SSL > 证书 > 服务器证书。
-
选择要更新的证书,然后单击 更新。
-
选择 更新证书和密钥。
-
在证书文件名中,单击选择文件>本地,然后浏览到更新的 .pfx 文件或证书 PEM 文件。
-
如果您上传 .pfx 文件,系统将提示您指定 .pfx 文件密码。
-
如果您上传证书 pem 文件,则还必须上传证书密钥文件。如果密钥已加密,则必须指定加密密码。
-
-
如果新证书的公用名与旧证书不匹配,则选择无域检查。
-
单击确定。将自动更新此证书绑定到的所有 SSL 虚拟服务器。
-
替换证书后,您可能需要将证书链接更新到新的中间证书。有关在不破坏链接的情况下更新中间证书的更多信息,请参阅更新中间证书而不破坏链接。
-
右键单击更新的证书,然后单击 Cert 链接,以查看它是否链接到中间证书。
-
如果证书未链接,请右键单击更新的证书,然后单击链接将其链接到中间证书。如果没有看到链接选项,则必须首先在CA 证书”节点下的设备上安装新的中间证 书。
-
更新现有 CA 证书
更新现有 CA 证书的步骤与更新现有服务器证书的步骤相同。唯一的区别是在 CA 证书的情况下,您不需要密钥。
禁用域检查
在设备上替换 SSL 证书时,新证书上提到的域名必须与正在替换的证书的域名相匹配。例如,如果您有颁发给 abc.com 的证书,并且您正在使用颁发给 def.com 的证书进行更新,则证书更新将失败。
但是,如果您希望托管特定域的服务器托管新域,请在更新其证书之前禁用域检查。
使用 CLI 禁用证书的域检查
在命令提示符下,键入以下命令以禁用域检查并验证配置:
update ssl certKey <certkeyName> -noDomainCheck
show ssl certKey <certkeyName>
示例:
update ssl certKey sv -noDomainCheck
Done
show ssl certkey sv
Name: sv
Cert Path: /nsconfig/ssl/complete/server/server_rsa_512.pem
Key Path: /nsconfig/ssl/complete/server/server_rsa_512.ky
Format: PEM
Status: Valid, Days to expiration:9349
Certificate Expiry Monitor: DISABLED
Done
通过使用 GUI 禁用证书的域检查
- 导航到流量管理”>“SSL”>“证书”,选择一个证书,然后单击更新。
- 选择无域检查。
将 ADC 设备的默认证书替换为与设备主机名匹配的受信任 CA 证书
以下过程假定默认证书 (ns-server-certificate
) 绑定到内部服务。
- 导航到流量管理”>“SSL”>“SSL 证书”>“创建证书请求。
- 通用名称,键入
test.citrixadc.com
。 - 将 CSR 提交给受信任的证书颁发机构。
- 收到来自受信任 CA 的证书后,将文件复制到目
/nsconfig/ssl
录中。 - 导航到流量管理 > SSL > 证书 > 服务器证书。
- 选择默认服务器证书 (
ns-server-certificate
),然后单击更新。 - 在更新证书对话框的证书文件名中,浏览到签名后从 CA 收到的证书。
- 在密钥文件名字段中,指定默认的私钥文件名 (
ns-server.key
)。 - 选择无域检查。
- 单击确定。
启用到期监视器
SSL 证书在特定时间段内有效。典型部署包括多个处理 SSL 事务的虚拟服务器,绑定到这些服务器的证书可以在不同的时间过期。当配置的证书即将过期时,在设备上配置的过期监视器会在设备的 syslog 和 ns 审核日志中创建条目。
如果要为证书到期创建 SNMP 警报,则必须单独配置它们。
使用 CLI 为证书启用过期监视器
在命令提示符下,键入以下命令以启用证书的过期监视器并验证配置:
set ssl certKey <certkeyName> [-expiryMonitor ( ENABLED | DISABLED ) [-notificationPeriod <positive_integer>]]
show ssl certKey <certkeyName>
示例:
set ssl certKey sv -expiryMonitor ENABLED –notificationPeriod 60
Done
通过使用 GUI 为证书启用过期监视器
- 导航到流量管理”>“SSL”>“证书”,选择一个证书,然后单击更新。
- 选择到期时通知,并可选择指定通知期间。
更新中间证书而不破坏链接
您现在可以更新中间证书,而不会破坏任何现有链接。由要替换的证书颁发的链接证书中的“授权密钥标识符”扩展不得包含颁发机构证书序列号(“授权证书序列号”)字段。如果“AuthorityKeyIdentifier”扩展包含序列号字段,则旧证书和新证书的证书序列号必须相同。如果满足上述条件,您可以更新链接中的任意数量的证书(一次一个)。以前,如果更新了中间证书,则链接断开。
例如,有四个证书:CertA
、CertB
、CertC
和 CertD
。证书 CertA
是 CertB
的颁发者,CertB
是 CertC
的颁发者,以此类推。如果要将中间证书 CertB
替换为 CertB_new
(不断开链接),必须满足以下条件:
如果满足以下两个条件,则的 CertB
的证书序列号必须与 CertB_new
的证书序列号匹配:
-
AuthorityKeyIdentifier
扩展名存在于中CertC
。 - 此扩展包含序列号字段。
如果证书中的公用名更改,则在更新证书时指定nodomaincheck
。
在上面的示例中,要将“www.example.com”中CertD
更改为“*.example.com”,请选择“无域检查”参数。
使用 CLI 更新证书
在命令提示窗口中,键入:
update ssl certKey <certkeyName> -cert <string> [-password] -key <string> [-noDomainCheck]
示例:
update ssl certkey siteAcertkey -cert /nsconfig/ssl/cert.pem -key /nsconfig/ssl/pkey.pem -noDomainCheck
显示证书链
证书包含签发机构的名称和签发证书的对象。要验证证书,您必须查看该证书的颁发者并确认您是否信任颁发者。如果您不信任颁发者,则必须查看颁发者证书的颁发者。上升链,直到您到达根 CA 证书或您信任的颁发者。
作为 SSL 握手的一部分,当客户端请求证书时,设备会显示设备上存在的证书和颁发者证书链。管理员可以查看设备上存在的证书的证书链,并安装任何缺失的证书。
使用 CLI 查看设备上存在的证书的证书链
在命令提示窗口中,键入:
show ssl certchain <cert_name>
示例
有 3 个证书:c1、c2 和 c3。证书 c3 是根 CA 证书,签名 c2,c2 签名 c1。以下示例说明了不同方案中
show ssl certchain c1
命令的输出。
假设情况 1:
证书 c2 链接到 c1,c3 链接到 c2。
证书 c3 是根 CA 证书。
如果运行以下命令,则会显示到根 CA 证书的证书链接。
show ssl certchain c1
Certificate chain details of certificate name c1 are:
1) Certificate name: c2 linked; not a root certificate
2) Certificate name: c3 linked; root certificate
Done
假设情况 2:
证书 c2 链接到 c1。
证书 c2 不是根 CA 证书。
如果运行以下命令,则会显示证书 c3 是根 CA 证书但未链接到 c2 的信息。
show ssl certchain c1
Certificate chain details of certificate name c1 are:
1) Certificate Name: c2 linked; not a root certificate
2) Certificate Name: c3 not linked; root certificate
Done
假设情况 3:
证书 c1、c2 和 c3 未链接,但存在于设备上。
如果运行以下命令,则会显示以证书 c1 颁发者开始的所有证书的信息。还指定证书不链接。
show ssl certchain c1
Certificate chain details of certificate name c1 are:
1) Certificate Name: c2 not linked; not a root certificate
2) Certificate Name: c3 not linked; root certificate
Done
假设情况 4:
证书 c2 链接到 c1。
证书 c3 不存在于设备上。
如果运行以下命令,则会显示有关链接到 c1 的证书的信息。系统会提示您添加使用 c2 中指定的使用者名称的证书。在这种情况下,系统会要求用户添加根 CA 证书 c3。
show ssl certchain c1
Certificate chain details of certificate name c1 are:
1) Certificate Name: c2 linked; not a root certificate
2) Certificate Name: /C=IN/ST=ka/O=netscaler/CN=test
Action: Add a certificate with this subject name.
Done
设想情况 5:
证书未链接到证书 c1,并且设备上不存在 c1 的颁发者证书。
如果运行以下命令,系统会提示您在证书 c1 中添加使用主题名称的证书。
sh ssl certchain c1
Certificate chain details of certificate name c1 are:
1) Certificate Name: /ST=KA/C=IN
Action: Add a certificate with this subject name.