[KB8274] 使用 Windows 命令行为 ESET PROTECT On-Prem 创建认证机构或证书

注意:

本页已由电脑翻译。点击本页面语言下的英文,显示原文。如果你发现有什么不清楚的地方,请联系你当地的支持。

问题

解决方案

前提条件

安装 OpenSSL(适用于 Windows)。通过 OpenSSL 可以创建签名证书。


使用 Windows 命令行创建认证机构和证书

  1. 生成认证机构及其私钥。在命令提示符下运行

    openssl genrsa -out protect-custom-ca.key 2048 openssl req -x509 -new -nodes -key protect-custom-ca.key -sha256 -days 3650 -out protect-custom-ca.der -outform der -subj "/CN=PROTECT Custom CA"

    您可以用自己选择的文件名替换.key.der文件的protect-custom-ca

  2. 创建证书扩展文件(protect.ext)。

    证书扩展文件

    扩展文件定义服务器和代理证书所需的属性,以便通过主题备选名称 (SAN) 列出有效的 DNS 名称或域来定义其角色(终端实体,而非认证机构)和身份。

    这些属性可确保与 ESET PROTECT On-Prem 的正确验证和安全通信。

    在命令提示符中运行以下命令:

    • 对于一个域:

      echo authorityKeyIdentifier=keyid,issuer >>protect.ext echo basicConstraints=CA:FALSE >>protect.ext echo keyUsage=digitalSignature,keyEncipherment,dataEncipherment >>protect.ext echo subjectAltName=DNS:*.example.com >>protect.ext
    • 对于多个域:

      echo authorityKeyIdentifier=keyid,issuer >>protect.ext echo basicConstraints=CA:FALSE >>protect.ext echo keyUsage=digitalSignature,keyEncipherment,dataEncipherment >>protect.ext echo "subjectAltName=DNS:example.com,DNS:*.example.com,DNS:api.example.net" >>protect.ext

    替换:

    • authorityKeyIdentifier
      • keyid
      • 发行者

      用 OpenSSL 为你的认证机构生成的实际值替换这些值。

    • subjectAltName
      • 中的示例域与您环境中使用的 DNS 名称或域相同。

    请勿更改以下命令,因为这些命令对于 ESET PROTECT 是强制性的:

    • basicConstraints=CA:FALSE
    • keyUsage=digitalSignature,keyEncipherment,dataEncipherment

  3. 生成证书及其私钥,并导出为.pfx文件。

    通用名称字符串

    通用名 (CN) 必须包括服务器代理,具体取决于证书类型。

    在命令提示符中运行以下命令:

    • 对于 ESET PROTECT 服务器证书:

      openssl genrsa -out protect-server.key 2048 openssl req -new -key protect-server.key -subj "/CN=PROTECT Server" | openssl x509 -req -CA protect-custom-ca.der -CAkey protect-custom-ca.key -CAform DER -out protect-server.crt -days 1825 -sha256 -extfile protect.ext openssl pkcs12 -export -out protect-server.pfx -inkey protect-server.key -in protect-server.crt -passout pass:password

      密码替换为您选择的强密码。

    • 对于 ESET 管理代理证书

      openssl genrsa -out protect-agent.key 2048 openssl req -new -key protect-agent.key -subj "/CN=PROTECT Agent" | openssl x509 -req -CA protect-custom-ca.der -CAkey protect-custom-ca.key -CAform DER -out protect-agent.crt -days 1825 -sha256 -extfile protect.ext openssl pkcs12 -export -out protect-agent.pfx -inkey protect-agent.key -in protect-agent.crt -passout pass:password
      用您选择的强密码替换密码