Skip to content

Windows IIS 部署

适合 Windows Server + IIS 网站。

本页使用 Win-ACME 自动签发、安装和续期证书。

准备

  • 可以通过 RDP 登录 Windows Server。
  • IIS 中已经有对应域名的网站绑定,至少需要 80 端口。
  • 域名已经解析到该服务器。
  • 已取得 Server URL、EAB MAC ID、EAB MAC key。

TIP

如果 IIS 站点只使用默认通配绑定,Win-ACME 可能无法准确识别站点。请先为域名添加明确的 Host Name 绑定。

1. 安装 Win-ACME

  1. 打开 https://www.win-acme.com/
  2. 下载最新版本。
  3. 解压到:
text
C:\Program Files\Win-ACME
  1. 双击 wacs.exe 确认可运行。

2. 运行签发命令

用管理员身份打开 PowerShell。

单域名默认包含根域名和 www

powershell
& "C:\Program Files\Win-ACME\wacs.exe" `
  --source iis `
  --host "example.com,www.example.com" `
  --store certificatestore `
  --installation iis `
  --baseuri "你的 Server URL" `
  --eab-key-identifier "你的 EAB MAC ID" `
  --eab-key "你的 EAB MAC key" `
  --accepttos

多域名:

powershell
& "C:\Program Files\Win-ACME\wacs.exe" `
  --source iis `
  --host "example.com,www.example.com,example.net,shop.example.org" `
  --store certificatestore `
  --installation iis `
  --baseuri "你的 Server URL" `
  --eab-key-identifier "你的 EAB MAC ID" `
  --eab-key "你的 EAB MAC key" `
  --accepttos

3. 通配符证书

通配符默认包含:

text
example.com
*.example.com

通配符证书必须使用 DNS 验证。Win-ACME 需要安装对应 DNS 插件,例如 Cloudflare、Route53 或 Azure DNS。

Cloudflare 插件示例:

powershell
& "C:\Program Files\Win-ACME\wacs.exe" `
  --target manual `
  --host "example.com,*.example.com" `
  --validation cloudflare `
  --cloudflareapitoken "Cloudflare API Token" `
  --store certificatestore `
  --installation iis `
  --baseuri "你的 Server URL" `
  --eab-key-identifier "你的 EAB MAC ID" `
  --eab-key "你的 EAB MAC key" `
  --accepttos

WARNING

不同 Win-ACME 版本和 DNS 插件参数可能不同。请以你安装版本的 wacs.exe --help 输出为准。

4. 验证 IIS 绑定

打开:

text
Server Manager -> Tools -> Internet Information Services (IIS) Manager

进入:

text
Sites -> 你的站点 -> Bindings

确认已经生成 HTTPS 443 绑定。

5. 查看续期任务

powershell
& "C:\Program Files\Win-ACME\wacs.exe" --list --baseuri "你的 Server URL"

如果排查错误,可追加:

powershell
--verbose

6. 浏览器验证

text
https://example.com

12SSL SSL Certificates and AutoSSL.