背景

  1. 后web时代,https加密的重要性不言而喻。主流浏览器均对http站点标记不安全,敦促web服务提供商尽快升级至https。

  2. 原先的https证书多由各大域名服务商提供,动辄成千上万的部署证书的费用,一般个人站点及小微企业根本无力承担。感谢开源,我们现在拥有无需付费的 Let s Encrypt 证书进行选择。越来越多的企业开始加入Let s Encrypt 。

  3. Apple的上架审核,微信的小程序审核,都需要https证书作为支撑。

  4. Let s Encrypt 部署在Linux服务器下,有官方推荐Certbot客户端 可以说是非常方便了。而想在Windows Server上部署,我们还需要一系列的操作进行证书的生成。

准备

在Windows平台上,许多优秀的开源作者已经为我们提供了相当好用的 Let s Encrypt 客户端:

ACMESharp

Certify The Web

win-acme

ssl for free

制作证书

我用的第4个web客户端,win平台下win-acme , ACMESharp(基于PowserShell)这两种用的人都蛮多的。

  1. 输入你想要部署https证书的域名(截至2018年04月,Let s encrypt已经支持免费的通配符域名)

  2. 我选择的是 dns 校验方式。域名新增一条符合规则的 txt 记录就好。

  3. 注意!强烈推荐使用自己的 CSR !勾选 I have my own CSR 。确保证书的私钥仅有自己知道。

  4. Windows平台 CSR生成方式:

在Windows下,在 IIS 中选择服务器->服务器证书->创建申请证书。

密钥位长选2048位

得到txt格式的文件,将公钥复制到sslforfree中(截取-----BEGIN NEW CERTIFICATE REQUEST-----和-----END NEW CERTIFICATE REQUEST-----之间的内容)

  1. Linux平台 CSR文件生成方式

利用openssl

openssl req -new -nodes -sha256 -newkey rsa:2048 -keyout myprivate.key -out mydomain.csr
  1. 下载证书: 这里证书有两份文件,private.key和certificate.crt,其中private.key应该是空的,这表示用的自己的CSR,sslforfree网站并不知道private.key是多少,安全可靠。

  2. 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

部署证书

  1. 在 IIS 中选择服务器->服务器证书->导入上面生成的 pfx 文件。

  2. 选择站点,绑定https,选择证书。

  3. 开启入站的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证书的更多相关文章

  1. 在Windows Server 2008上部署SVN代码管理总结

    这段时间在公司开发Flex程序,所以使用TortoiseSVN作为团队代码管理器,今天在公司服务器上部署SVN服务器,并实验成功,总结如下: 服务器环境: 操作系统:Windows Server 20 ...

  2. Windows server 2008 上部署 MVC (NopCommerce 3.4)网站

    自己用开源框架做了个商城,该框架是基于mvc4的,本地编译通过,运行一切正常,关于发布遇到了好几个问题. 本地: IIS7.5. VS2013 总结后发现只需要设置两个问题,就不会有那些古怪的问题:什 ...

  3. 关于在windows server 2008 上部署wampserver2.5部署的问题

    1.关闭windows自带防火墙 2.httpd.conf文件权限 apache 2.4.9 外网访问的问题参考此文: http://blog.csdn.net/lysc_forever/articl ...

  4. 阿里云服务器Windows Server 2008/2012部署Office Web Server 2013

    以前成功将Office Web Server 2013部署在了本地服务器上,此次是将Office Web Server 2013部署在阿里云服务器Windows Server 2008和2012上,中 ...

  5. 无需破解:Windows Server 2008 R2 至少免费使用 900天

    无需破解:Windows Server 2008 R2 至少免费使用 900天 2009年10月30日 星期五 02:10 1.首先安装后,有一个180天的试用期. 2.在180天试用期即将结束时,使 ...

  6. Windows Server 2008 R2 部署服务

    Windows Server 2008 R2 部署服务 部分参考: Windows Server 2008 R2 部署服务 - 马睿的技术博客 - 51CTO技术博客http://marui.blog ...

  7. asp.net网站部署在云服务器windows server 2008上

    搭建一个网站需要以下4个准备: 1.域名解析 2.(云)服务器 3.数据库 4.网站代码 其中1可以可以去DNSPOD申请,同时需要进行备案,在上面就都可以完成.2用的是阿里云服务器windows s ...

  8. 针对 SQL Server 2008 在Windows Server 2008上的访问配置 Windows 防火墙

    现在Windows Server 2008 服务器用的越来越多,2008的防火墙比2003的有了很大的增强,安全性有了更大的提高. 甚至80端口的出站默认都是被关闭的.所以如果在2008Server上 ...

  9. SQLite 在Windows Server 2008 R2 部署问题FAQ汇总[轉]

    轉自:http://www.steveluo.name/sqlite-windows-server-2008-r2-deploy-faq/ 今天花了一天的时间研究了一下SQLite,以取代一些轻量级项 ...

随机推荐

  1. solr之高级查询--联表 join查询

    例如有两个业务表:文章表,评论表 . 场景: 一个文章可以由多个人评论. 创建两个core,一个core叫article,一个叫comment.article实例的schema.xml文件中定义几个简 ...

  2. FTP和TCP、UDP

    应用:TFTP客户端 1. TFTP协议介绍 TFTP(Trivial File Transfer Protocol,简单文件传输协议) 是TCP/IP协议族中的一个用来在客户端与服务器之间进行简单文 ...

  3. oracle 安装包

    Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Microsoft Windows (32-bit ...

  4. IE浏览器中不支持cookie问题

    /** * Cookie plugin * * Copyright (c) 2006 Klaus Hartl (stilbuero.de) * Dual licensed under the MIT ...

  5. ubuntu14.04环境下利用docker搭建solrCloud集群

    在Ubuntu14.04操作系统的宿主机中,安装docker17.06.3,将宿主机的操作系统制作成docker基础镜像,之后使用自制的基础镜像在docker中启动3个容器,分配固定IP,再在3个容器 ...

  6. 二叉树叶子顺序遍历 · binary tree leaves order traversal

    [抄题]: 给定一个二叉树,像这样收集树节点:收集并移除所有叶子,重复,直到树为空. 给出一个二叉树: 1 / \ 2 3 / \ 4 5 返回 [[4, 5, 3], [2], [1]]. [暴力解 ...

  7. mybatis框架入门程序:演示通过mybatis实现数据库的模糊查询操作

    1. mybatis的基本准备操作见我的上一篇博文:https://www.cnblogs.com/wyhluckdog/p/10149480.html 2. 根据用户名查询用户信息: (1)映射文件 ...

  8. Halcon二维仿射变换实例探究

    二维仿射变换,顾名思义就是在二维平面内,对对象进行平移.旋转.缩放等变换的行为(当然还有其他的变换,这里仅论述这三种最常见的). Halcon中进行仿射变换的常见步骤如下: ① 通过hom_mat2d ...

  9. VMWare 虚拟机挂载 Homestead NFS 进行老项目(基于 Brophp)维护

    环境: Laravel/homestead + winnfsd VMWare workstation 背景: 众所周知, windows 上成功配置 Homestead 进行开发时,为了解决文件系统的 ...

  10. [Training Video - 1] [Selenium Basics] [Xpath Selenium]

    FirePath Press F12, you will see :