答案1
客户端可以信任更深层次的证书,但它完全自动。
对于大多数 TLS 服务器,除了用于该端点的证书之外,您还可以提供一组中间证书。
因此 Letsencrypt 根受到大多数浏览器/客户端的信任
但是 Letsencrypt 的证书来自通常不直接信任的更深层次的 CA。服务器必须包含中间层。
因此,当客户端建立连接时,它将获得中间件以及它所连接的资源的证书。它将尝试从根开始,通过中间件,直至证书建立信任链。
让我们看看https://serverfault.com/。我的系统仅信任顶级“DigiCert”CA,它不信任“DigiCert High Assurance EV Root CA”。但我可以使用https://serverfault.com/因为服务器返回了中间体。
如果你想启动 CLI,你可以使用 openssl 查看证书
echo '' | openssl s_client -showcerts -connect serverfault.com:443
CONNECTED(00000003)
depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert High Assurance EV Root CA
verify return:1
depth=1 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert SHA2 High Assurance Server CA
verify return:1
depth=0 C = US, ST = NY, L = New York, O = "Stack Exchange, Inc.", CN = *.stackexchange.com
verify return:1
---
Certificate chain
0 s:/C=US/ST=NY/L=New York/O=Stack Exchange, Inc./CN=*.stackexchange.com
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
-----BEGIN CERTIFICATE-----
MIIIP... # the intermediate
-----END CERTIFICATE-----
1 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
-----BEGIN CERTIFICATE-----
MIIEs... # cert for stackexchange
-----END CERTIFICATE-----
---
Server certificate
subject=/C=US/ST=NY/L=New York/O=Stack Exchange, Inc./CN=*.stackexchange.com
issuer=/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
---
No client certificate CA names sent
Peer signing digest: SHA512
Server Temp Key: X25519, 253 bits
---
SSL handshake has read 3945 bytes and written 269 bytes
Verification: OK
---
New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256
...
因此,客户端不会自动信任更深层次的 CA,但可以轻松配置以使证书值得信任。