windows下部署免费ssl证书(letsencrypt)的方法

2019-10-16 19:36:48于丽

  当前受到主流浏览器承认的很多SSL证书机构颁发的免费证书主要也都是DV等级。下面我介绍一下最近比较知名的 Letencrypt 免费ssl证书在windows下的部署过程。

二. 免费Letencrypt证书部署

  这个是由国外发起的一个免费的ssl项目,现在已经得到了谷歌等主流浏览器的认可。从安全角度考虑,通过Letencrypt安装的免费证书只有三个月的有效期,到期之需要重新申请,但是这也给部署造成了一定的麻烦,所以官方也提供了各种自动化的解决方案,这里我介绍的是windows下的证书申请和自动更新工具 letsencrypt-win-simple。

  首先我们下载   GitHub地址(https://github.com/Lone-Coder/letsencrypt-win-simple/releases) 并解压

  因为安装过程需要在站点下生成验证文件,所以请以管理员模式进入cmd界面,也可以右键开始菜单 点击 命令提示符(管理员)选项

进入解压文件夹,运行 letsencrypt.exe --san 命令

执行完之后会自动将IIS下的所有网站列出来,后边会有如下几个选项:

这几个选项分别对应不同的情况,这里因为我的机器下有好几个站点,我想给他们统一颁发一个证书,我选择S,之后它会提示你输入要安装的站点序号,这里我输入 3,4

接下来它会在每个站点下创建一个里验证文件,验证通过之后就会生成对应证书添加到IIS中,如果一切正常的情况下会在任务管理中创建一个定时更新任务。

当前这个软件还存在一些bug,我个人在安装中也遇到了几个异常终止的错误,重复操作两次才正常通过,如果你也遇到问题,可以直接去IIS下证书管理,查看是否已经创建了对应的证书,如果存在可以手动绑定。

三. 注意事项

  使用Letencrypt时有一定的次数限制,以防止申请的滥用,这里是 官方网站 给出的限制信息:

If you have a lot of subdomains, you may want to combine them into a single certificate, up to a limit of 100 Names per Certificate. Combined with the above limit, that means you can issue certificates containing up to 2,000 unique subdomains per week. A certificate with multiple names is often called a SAN certificate, or sometimes a UCC certificate.

We also have a Duplicate Certificate limit of 5 certificates per week. A certificate is considered a duplicate of an earlier certificate if they contain the exact same set of hostnames, ignoring capitalization and ordering of hostnames. For instance, if you requested a certificate for the names [www.example.com, example.com], you could request four more certificates for [www.example.com, example.com] during the week. If you changed the set of names by adding [blog.example.com], you would be able to request additional certificates.