在Windows Server 2008上部署免费的https证书
背景
后web时代,https加密的重要性不言而喻。主流浏览器均对http站点标记不安全,敦促web服务提供商尽快升级至https。
原先的https证书多由各大域名服务商提供,动辄成千上万的部署证书的费用,一般个人站点及小微企业根本无力承担。感谢开源,我们现在拥有无需付费的 Let s Encrypt 证书进行选择。越来越多的企业开始加入Let s Encrypt 。
Apple的上架审核,微信的小程序审核,都需要https证书作为支撑。
Let s Encrypt 部署在Linux服务器下,有官方推荐Certbot客户端 可以说是非常方便了。而想在Windows Server上部署,我们还需要一系列的操作进行证书的生成。
准备
在Windows平台上,许多优秀的开源作者已经为我们提供了相当好用的 Let s Encrypt 客户端:
制作证书
我用的第4个web客户端,win平台下win-acme , ACMESharp(基于PowserShell)这两种用的人都蛮多的。
输入你想要部署https证书的域名(截至2018年04月,Let s encrypt已经支持免费的通配符域名)
我选择的是 dns 校验方式。域名新增一条符合规则的 txt 记录就好。
注意!强烈推荐使用自己的 CSR !勾选 I have my own CSR 。确保证书的私钥仅有自己知道。
Windows平台 CSR生成方式:
在Windows下,在 IIS 中选择服务器->服务器证书->创建申请证书。
密钥位长选2048位
得到txt格式的文件,将公钥复制到sslforfree中(截取-----BEGIN NEW CERTIFICATE REQUEST-----和-----END NEW CERTIFICATE REQUEST-----之间的内容)
- Linux平台 CSR文件生成方式
利用openssl
openssl req -new -nodes -sha256 -newkey rsa:2048 -keyout myprivate.key -out mydomain.csr
下载证书: 这里证书有两份文件,private.key和certificate.crt,其中private.key应该是空的,这表示用的自己的CSR,sslforfree网站并不知道private.key是多少,安全可靠。
crt证书转为iis可用的pfx证书。
这里需要使用open ssl,如果你有Linux服务器或虚拟机的话很方便。否则需要自行Google win平台安装open ssl的方法。
Linux平台下利用open ssl ,利用生成csr文件的private.key,执行下面的命令
openssl pkcs12 -export -out server.pfx -inkey private.key -in certificate.crt
部署证书
在 IIS 中选择服务器->服务器证书->导入上面生成的 pfx 文件。
选择站点,绑定https,选择证书。
开启入站的443端口,至此,部署完毕。
微信小程序 TLS 1.2
由于小程序要求的TLS版本必须大于等于1.2 , 而windows server 2008默认为TLS 1.0
1.解决方案:在Powershell中运行下面代码后重启。
# Enables TLS 1.2 on windows Server 2008 R2 and Windows 7
# These keys do not exist so they need to be created prior to setting values.
md "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2"
md "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server"
md "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client"
# Enable TLS 1.2 for client and server SCHANNEL communications
new-itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server" -name "Enabled" -value 1 -PropertyType "DWord"
new-itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server" -name "DisabledByDefault" -value 0 -PropertyType "DWord"
new-itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" -name "Enabled" -value 1 -PropertyType "DWord"
new-itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" -name "DisabledByDefault" -value 0 -PropertyType "DWord"
# Disable SSL 2.0 (PCI Compliance)
md "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server"
new-itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server" -name Enabled -value 0 -PropertyType "DWord"
# Enables TLS 1.2 on Windows Server 2008 R2 and Windows 7 # These keys do not exist so they need to be created prior to setting values. md "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2" md "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server" md "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" # Enable TLS 1.2 for client and server SCHANNEL communications new-itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server" -name "Enabled" -value 1 -PropertyType "DWord" new-itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server" -name "DisabledByDefault" -value 0 -PropertyType "DWord" new-itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" -name "Enabled" -value 1 -PropertyType "DWord" new-itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" -name "DisabledByDefault" -value 0 -PropertyType "DWord" # Disable SSL 2.0 (PCI Compliance) md "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server" new-itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server" -name Enabled -value 0 -PropertyType "DWord"
2.注意:TLS 1.2 至少需要服务器版本为Windows Server 2008 Service Pack 2 (SP2)
在Windows Server 2008上部署免费的https证书的更多相关文章
- 在Windows Server 2008上部署SVN代码管理总结
这段时间在公司开发Flex程序,所以使用TortoiseSVN作为团队代码管理器,今天在公司服务器上部署SVN服务器,并实验成功,总结如下: 服务器环境: 操作系统:Windows Server 20 ...
- Windows server 2008 上部署 MVC (NopCommerce 3.4)网站
自己用开源框架做了个商城,该框架是基于mvc4的,本地编译通过,运行一切正常,关于发布遇到了好几个问题. 本地: IIS7.5. VS2013 总结后发现只需要设置两个问题,就不会有那些古怪的问题:什 ...
- 关于在windows server 2008 上部署wampserver2.5部署的问题
1.关闭windows自带防火墙 2.httpd.conf文件权限 apache 2.4.9 外网访问的问题参考此文: http://blog.csdn.net/lysc_forever/articl ...
- 阿里云服务器Windows Server 2008/2012部署Office Web Server 2013
以前成功将Office Web Server 2013部署在了本地服务器上,此次是将Office Web Server 2013部署在阿里云服务器Windows Server 2008和2012上,中 ...
- 无需破解:Windows Server 2008 R2 至少免费使用 900天
无需破解:Windows Server 2008 R2 至少免费使用 900天 2009年10月30日 星期五 02:10 1.首先安装后,有一个180天的试用期. 2.在180天试用期即将结束时,使 ...
- Windows Server 2008 R2 部署服务
Windows Server 2008 R2 部署服务 部分参考: Windows Server 2008 R2 部署服务 - 马睿的技术博客 - 51CTO技术博客http://marui.blog ...
- asp.net网站部署在云服务器windows server 2008上
搭建一个网站需要以下4个准备: 1.域名解析 2.(云)服务器 3.数据库 4.网站代码 其中1可以可以去DNSPOD申请,同时需要进行备案,在上面就都可以完成.2用的是阿里云服务器windows s ...
- 针对 SQL Server 2008 在Windows Server 2008上的访问配置 Windows 防火墙
现在Windows Server 2008 服务器用的越来越多,2008的防火墙比2003的有了很大的增强,安全性有了更大的提高. 甚至80端口的出站默认都是被关闭的.所以如果在2008Server上 ...
- SQLite 在Windows Server 2008 R2 部署问题FAQ汇总[轉]
轉自:http://www.steveluo.name/sqlite-windows-server-2008-r2-deploy-faq/ 今天花了一天的时间研究了一下SQLite,以取代一些轻量级项 ...
随机推荐
- 【DataGuard】部署Data Guard相关参数详解 (转载)
原文地址:[DataGuard]部署Data Guard相关参数详解 作者:secooler 有关物理Data Guard部署参考<[DataGuard]同一台主机实现物理Data Gua ...
- 读Understanding the Linux Kernel, 3rd Edition有感
14.3.2.2. Avoiding request queue congestion Each request queue has a maximum number of allowed pendi ...
- 无法定位程序输入点 Can't load package
---------------------------Toggle Form/Unit (F12): bcb.exe - 无法找到入口--------------------------- 无法定位程 ...
- 迷你MVVM框架 avalonjs 1.2.4发布
这段时间一直忙于建立avalon的单元测试,与重构官网.对avalon的更新都是来自公司内部的需求,性能优化与一些BUG修复. 添加大量调试日志. 重构shimController,以提高性能. cr ...
- eclipse中使用maven的 maven install
windows -> preferences -> Java -> Installed JREs 在default VM arguments 中添加 -Dmaven.multiMod ...
- Spring集成Mybatis配置文件的简单理解
详情可见官方文档http://www.mybatis.org/spring/zh/index.html 一.需要配置的对象实例 1.SqlSessionFactoryBean 在 MyBatis-Sp ...
- PHP 将HTML转成PDF文件,HTML 转word,Word 转Html
html转 PDF 用MPDF ,Word转Html 纯PHP的方法暂未找到Word直接转PDF的方法 可以使用 LibreOffice 6.1 (Liunx,win) 皆可使用 Html转成PD ...
- [leetcode]301. Remove Invalid Parentheses 去除无效括号
Remove the minimum number of invalid parentheses in order to make the input string valid. Return all ...
- Sensitivity, specificity, and reproducibility of RNA-Seq differential expression calls RNA-Seq差异表达调用的灵敏度 特异性 重复性
Sensitivity, specificity, and reproducibility of RNA-Seq differential expression calls RNA-Seq差异表达调用 ...
- [Laravel] mac下通过 homestead 搭建环境 到运行项目
seven_Android 关注 2017.07.03 21:33* 字数 2240 阅读 3464评论 10喜欢 9 之前学习过一段时间的 Laravel ,换 mac 后一直没空做相关的事情,而且 ...