Chinese (Simplified Han script) (Boost Beast Translation - en to zh_Hans translation catalogue (40 entries)

note: type: section title
en: SSL/TLS Certificate
zh_Hans: SSL/TLS 证书

note: type: heading
en: Certificate Authority
zh_Hans: 证书授权机构

note: type: paragraph
en: A Certificate Authority (CA) is a trusted entity that signs digital certificates, enabling users to verify their authenticity. Rather than storing every individual certificate for each server (which would be impractical due to the sheer volume and frequent renewals), users can store a limited set of root certificates to authenticate server certificates as needed.
zh_Hans: 证书授权机构（CA）是一种可信实体，负责对数字证书进行签名，以便用户验证其真实性。由于服务器证书数量庞大且更新频繁，为每台服务器单独存储所有证书并不现实。因此，用户只需存储有限数量的根证书，即可在需要时验证服务器证书。

note: type: paragraph
en: Boost.Asio provides various methods for loading certificate authority certificates:
zh_Hans: Boost.Asio 提供多种加载证书授权机构证书的方法：

note: type: paragraph
en: It is important to set up peer verification so that the TLS/SSL handshake fails if certificate verification is unsuccessful:
zh_Hans: 设置对端验证非常重要，这样当证书验证失败时，TLS/SSL 握手也会随之失败：

note: type: paragraph
en: A client must also verify that the hostname or IP address in the certificate matches the expected one. The [@boost:/doc/html/boost_asio/reference/ssl__host_name_verification.html `net::ssl::host_name_verification`] helper function object can perform this verification according to the rules described in RFC 6125:
zh_Hans: 客户端还需验证证书中的主机名或 IP 地址是否与预期一致。[@boost:/doc/html/boost_asio/reference/ssl__host_name_verification.html `net::ssl::host_name_verification`] 这个辅助函数对象，可以按照 RFC 6125 描述的规则来完成验证：

note: type: paragraph
en: A server can also request and verify a client certificate to authenticate the client:
zh_Hans: 服务器也可以请求并验证客户端证书，以对客户端进行身份认证：

note: type: heading
en: Server Certificate
zh_Hans: 服务器证书

note: type: paragraph
en: A Server Certificate is a digital certificate that confirms a server's identity as the legitimate destination for a client. It contains a verifiable signature that ensures it was issued by a trusted certificate authority (CA).
zh_Hans: 服务器证书是一种数字证书，用于确认服务器身份是客户端的合法目的地。它包含可验证的签名，用于确保证书由受信任的证书授权机构（CA）签发。

note: type: paragraph
en: When a server certificate is issued by an intermediate certificate authority, and the client lacks those intermediate certificates, the server should provide all the relevant certificates to the client. This allows the client to verify the final certificate in the chain against the root certificate.
zh_Hans: 当服务器证书由中间证书授权机构签发，且客户端缺少这些中间证书时，服务器应向客户端提供所有相关证书。这使得客户端能够根据根证书验证证书链中的最终证书。

note: type: paragraph
en: The following Boost.Asio methods can be used for loading a certificate or a certificate chain:
zh_Hans: 以下 Boost.Asio 方法可用于加载单个证书或证书链：

note: type: heading
en: Client Certificate
zh_Hans: 客户端证书

note: type: paragraph
en: A server can authenticate clients by requiring and verifying their certificates, preventing access for those without a valid certificate and private key. The server enforces this by modifying peer verification settings:
zh_Hans: 服务器可以通过要求并验证客户端证书来对客户端进行身份认证，从而阻止没有有效证书和私钥的客户端访问。服务器通过修改对端验证设置来实施这一机制：

note: type: paragraph
en: If used, the necessary CA certificates must be loaded into the server's SSL context to enable verification of the client's certificate.
zh_Hans: 若使用该机制，则需将必要的 CA 证书加载到服务器的 SSL 上下文中，以便能够验证客户端的证书。

note: type: heading
en: Common Name and Subject Alternative Name
zh_Hans: 通用名称与主题备用名称

note: type: paragraph
en: The Subject Alternative Name (SAN) is an extension in X.509 certificates that allows multiple domain names, subdomains, or IP addresses to be associated with a single SSL/TLS certificate. Before that it was the Common Name field in the certificate subject which could contain a single hostname.
zh_Hans: 主题备用名称（SAN）是 X.509 证书中的一种扩展字段，允许将多个域名、子域名或 IP 地址关联到同一张 SSL/TLS 证书上。在此之前，证书主题中的通用名称字段只能包含单个主机名。

note: type: paragraph
en: recommends that if a certificate includes a SAN dNSName field, the client must ignore the subject CN field. Some modern browsers, such as Google Chrome, check only the SAN section in an SSL/TLS certificate and reject certificates that contain only the CN field.
zh_Hans: 该建议指出，如果证书中包含 SAN 的 dNSName 字段，客户端必须忽略主题 CN 字段。某些现代浏览器（例如 Google Chrome）仅检查 SSL/TLS 证书中的 SAN 部分，并拒绝仅包含 CN 字段的证书。

note: type: heading
en: Private Key
zh_Hans: 私钥

note: type: paragraph
en: The private key of a certificate is required during the SSL/TLS handshake to prove that the certificate's provider is its rightful owner
zh_Hans: 证书的私钥在 SSL/TLS 握手过程中是必需的，用于证明证书的提供方是该证书的合法所有者。

note: type: paragraph
en: The following Boost.Asio methods can be used for loading a private key:
zh_Hans: 以下 Boost.Asio 方法可用于加载私钥：

note: type: paragraph
en: If the private key is secured with a password, the [@boost:/doc/html/boost_asio/reference/ssl__context/set_password_callback.html net::ssl::context::set_password_callback] allows specifying a callable object to retrieve the password.
zh_Hans: 如果私钥受密码保护，可以使用 [@boost:/doc/html/boost_asio/reference/ssl__context/set_password_callback.html net::ssl::context::set_password_callback] 设置一个可调用对象，用于获取该密码。

note: type: heading
en: Self-Signed and Self-Issued Certificates
zh_Hans: 自签名证书与自颁发证书

note: type: paragraph
en: A self-issued certificate is a certificate where the issuer and subject are the same entity.
zh_Hans: 自颁发证书是指证书的颁发者与主体为同一实体。

note: type: paragraph
en: A self-signed certificate is a self-issued certificate in which the digital signature can be verified using the public key within the certificate.
zh_Hans: 自签名证书是一种自颁发证书，其数字签名可使用证书内的公钥进行验证。

note: type: paragraph
en: Installing an untrusted, self-issued, or self-signed CA certificate poses a
zh_Hans: 安装不受信任、自颁发或自签名的 CA 证书会带来安全风险。

note: type: heading
en: Diffie-Hellman (DH) Parameters
zh_Hans: Diffie-Hellman（DH）参数

note: type: paragraph
en: Diffie-Hellman (DH) key exchange is a cryptographic protocol that allows two parties to securely establish a shared secret over an insecure communication channel. The key exchange process involves both parties agreeing on a set of parameters, known as Diffie-Hellman parameters, which include a large prime number `p` and a generator `g`. Since generating these parameters is a computationally expensive task, a user might prefer to provide a precomputed value at startup.
zh_Hans: Diffie-Hellman（DH）密钥交换是一种密码学协议，允许双方在不安全的通信通道上安全地建立共享密钥。该密钥交换过程涉及双方约定一组参数，即 Diffie-Hellman 参数，其中包括一个大素数 `p` 和一个生成元 `g`。由于生成这些参数是一项计算开销较大的任务，用户可能更倾向于在启动时提供预先计算好的值。

note: type: paragraph
en: The following Boost.Asio methods can be used for loading DH parameters:
zh_Hans: 以下 Boost.Asio 方法可用于加载 DH 参数：

note: type: paragraph
en: If no DH parameter is provided, OpenSSL will refuse to perform any handshake that uses DHE-based cipher suites but will still work with other cipher suites, such as those based on ECDHE.
zh_Hans: 如果未提供 DH 参数，OpenSSL 将拒绝执行任何使用基于 DHE 的加密套件的握手，但仍可与其他加密套件（例如基于 ECDHE 的套件）正常工作。

note: type: heading
en: A Self-Issued Certificate Example
zh_Hans: 自颁发证书示例

note: type: paragraph
en: In the following example, we will generate a self-signed CA certificate and use it to issue both server and client certificates.
zh_Hans: 在以下示例中，将生成一个自签名的 CA 证书，并使用该证书来签发服务器证书和客户端证书。

note: type: list
en: * Generate a CA certificate:
zh_Hans: * 生成 CA 证书：

note: type: list
en: * Generate a Server CSR:
zh_Hans: * 生成服务器证书签名请求（CSR）：

note: type: list
en: * Generate a Client CSR:
zh_Hans: * 生成客户端证书签名请求（CSR）：

note: type: list
en: * Sign the Client CSR using our CA:
zh_Hans: * 使用 CA 对客户端 CSR 进行签名：

note: type: list
en: * Generate a DH parameters file:
zh_Hans: * 生成 DH 参数文件：

note: type: paragraph
en: Server example: [path_link example/doc/ssl/server.cpp server.cpp]
zh_Hans: 服务器端示例：[path_link example/doc/ssl/server.cpp server.cpp]

note: type: paragraph
en: Note that the server is configured in such a way that it requests and verifies the client certificate. You can disable this by commenting out the related line in the example.
zh_Hans: 注意，该服务器的配置方式要求对客户端证书进行请求和验证。如果需要禁用此功能，可以注释掉示例中的相关代码行。

note: type: paragraph
en: You can test the server using this cURL command:
zh_Hans: 可以使用以下 cURL 命令测试该服务器：

note: type: paragraph
en: Also, you can use the client example: [path_link example/doc/ssl/client.cpp client.cpp]
zh_Hans: 此外，也可以使用客户端示例：[path_link example/doc/ssl/client.cpp client.cpp]
