0aa8fe6
这次没有正文改动。
这是 windows/AD CS 证书服务.md 的改动记录。后台每次保存都会留一份快照,
这里显示的是快照之间的差异,不会混入其他文章的改动。
还没有后台修改记录。
下面是 Git 里的提交,可能包含其他文章的改动(因为一次提交会带上工作区所有变化)。
0aa8fe6
这次没有正文改动。
42afade
@@ -0,0 +1,70 @@ +--- +tags: [AD CS, 证书服务, Windows] +order: 150 +--- + +# AD CS 证书服务 + +## 场景 + +内网一堆系统要 HTTPS,不想每台都自签,也不想年年买证书。 + +## 前置条件 + +- 域环境,企业管理员权限 +- 一台独立服务器(别装在域控上) +- 规划好 CA 名称,装完改不了 + +## 配置 + +```powershell +# 1. 装企业根 CA +Install-WindowsFeature -Name AD-Certificate, ADCS-Cert-Authority -IncludeManagementTools + +Install-AdcsCertificationAuthority -CAType EnterpriseRootCa ` + -CACommonName "Corp-Root-CA" -KeyLength 2048 -HashAlgorithm SHA256 ` + -ValidityPeriodYears 20 -Force + +# 2. 装 Web 注册(方便申请证书) +Install-WindowsFeature -Name ADCS-Web-Enrollment -IncludeManagementTools +Install-AdcsWebEnrollment -Force + +# 3. 申请 Web 服务器证书 +$inf = @" +[NewRequest] +Subject = "CN=kb.corp.local" +KeyLength = 2048 +KeyAlgorithm = RSA +ProviderName = "Microsoft RSA SChannel Cryptographic Provider" +RequestType = PKCS10 +[Extensions] +2.5.29.17 = "{text}DNS=kb.corp.local&DNS=www.kb.corp.local" +"@ +certreq -new web.inf web.req +certreq -submit web.req web.cer +``` + +## 验证 + +```powershell +Get-CACrlDistributionPoint +certutil -CAInfo +certutil -ping +``` + +浏览器打开 `http://ca.corp.local/certsrv` 能申请证书。 + +## 回滚 + +```powershell +Uninstall-AdcsCertificationAuthority -Force +``` + +## 坑 + +- **CA 名称装完不能改**,想清楚再装。 +- 根 CA 私钥丢了整个 PKI 报废,务必备份。 +- CRL 分发点不可达,证书校验会失败。 +- 装在域控上会拖慢登录,也会带来安全风险。 +- 证书模板权限没配,普通用户申请不了。 +- 服务器时间不对,签出来的证书直接无效。