2.5、Windows服务器下添加SSL证书
微信小程序数据交互要求为https协议,故我们的api接口端访问域名必须支持此协议,故我们需要在服务器安装ssl证书,以保证域名的支持https绑定。
准备工作
- 一台windows服务器。
- 一个支持iis版本的ssl证书包,未获取的请先申请,获取方法请参考 https://www.coreshop.cn/Doc/Details/13
下载证书
当我们在阿里云申请免费的ssl证书后,我们可以下载IIS支持包。
![](https://files.cdn.corecms.net/web/20211116/20211116214221_1929.png)
![](https://files.cdn.corecms.net/web/20211116/20211116214238_7857.png)
安装证书
首先我们将下载后的整数包解压,获得一个包含申请域名的 .pfx
后缀的文件,以及一个命名为pfx-password.txt
的密码文本文档。我们将两个文件复制到服务器,然后按照以下步骤操作。
![](https://files.cdn.corecms.net/web/20211116/20211116214734_2822.png)
![](https://files.cdn.corecms.net/web/20211116/20211116215119_5419.png)
![](https://files.cdn.corecms.net/web/20211116/20211116215147_5887.png)
![](https://files.cdn.corecms.net/web/20211116/20211116215202_2407.png)
![](https://files.cdn.corecms.net/web/20211116/20211116215213_2973.png)
![](https://files.cdn.corecms.net/web/20211116/20211116215242_3787.png)
![](https://files.cdn.corecms.net/web/20211116/20211116215525_4911.png)
![](https://files.cdn.corecms.net/web/20211116/20211116215553_8210.png)
![](https://files.cdn.corecms.net/web/20211116/20211116215616_5535.png)
![](https://files.cdn.corecms.net/web/20211116/20211116215728_8721.png)
![](https://files.cdn.corecms.net/web/20211116/20211116215826_3205.png)
![](https://files.cdn.corecms.net/web/20211116/20211116215938_8295.png)
![](https://files.cdn.corecms.net/web/20211116/20211116215949_1486.png)
![](https://files.cdn.corecms.net/web/20211116/20211116215957_4269.png)
![](https://files.cdn.corecms.net/web/20211116/20211116220006_1666.png)
![](https://files.cdn.corecms.net/web/20211116/20211116220039_6927.png)
![](https://files.cdn.corecms.net/web/20211116/20211116220129_8264.png)
![](https://files.cdn.corecms.net/web/20211116/20211116220210_1147.png)
然后我们前往IIS绑定域名:
![](https://files.cdn.coreshop.cn/web/20220311/20220311103013_0868.png)
![](https://files.cdn.coreshop.cn/web/20220311/20220311103133_9062.png)