中央证书存储

IIS 的中央证书存储(CCS)功能提供了一种机制,用于将证书放置在文件共享中供多个 Web 服务器使用。 可以通过 CCS API /api/webserver/centralized-certificates/{id}启用、禁用和配置此功能。

要求

若要启用中央证书存储,API 必须具有对存储将配置为使用的物理路径的读取访问权限。 此访问权限在 应用程序设置的文件部分中授予。 尝试将 CCS 的路径设置为不允许的物理路径将导致 403 禁止 错误。

检查是否已启用 CCS

如果禁用中央证书存储功能,ccs 终结点将返回 404 未安装的功能 响应。

未启用 CCS 时,GET/api/webserver/centralized-certificates/{id}

{
    "title": "Not found",
    "detail": "IIS feature not installed",
    "name": "IIS Central Certificate Store",
    "status": "404"
}

启用 CCS

若要启用中央证书存储,应将 POST 请求发送到 CCS API 终结点以及启用该功能所需的所有数据。

POST/api/webserver/centralized-certificates/{id}

{
    "path": "\\\\FileShare\\certs",
    "identity": {
        "username": "{Username of windows identity used to access file share}"
        "password": "{Password of windows identity used to access file share}"
    },
    "private_key_password": "{Password used to encrypt private keys}"
}

更新 CCS

可以使用具有更新设置的 PATCH 请求修改中央证书存储设置。

禁用 CCS

若要禁用中央证书存储,应将 DELETE 请求发送到 CCS 终结点。

DELETE/api/webserver/centralized-certificates/{id}

204 No Content

读取 CCS 证书

启用中央证书存储后,可以通过 证书 API 查看其证书。 为了填充 CCS 证书,CCS 配置为使用的文件共享必须允许对运行 API 的计算机进行读取访问。 此行为与将文件共享与 文件 API相同。