问题描述
我在Windows 8.1(在Mac上为Bootcamp)上运行localhost,并且需要启用ssl.
I run localhost on my Windows 8.1 (Bootcamp on Mac) and need to enable ssl.
我已经在127.0.0.1和localhost上拥有默认服务器证书.我在端口443上将一个localhost分配给了我的网站.
I have already default server certificates on 127.0.0.1 and localhost.I have the localhost one assigned to my websites on port 443.
https仍然返回安全错误,因此我需要使用http
https still returns security error so I need to work on http
我的网站在44300端口上运行(例如localhost:44300)我试图将证书绑定到44300,但仍然无法正常工作.
My websites run on 44300 port (eg. localhost:44300)I tried to bind the certificate to 44300, still it didn't work.
如何使我的locahost与https一起使用?谢谢
How to make my locahost to work with https? Thanks
编辑
该证书由本地主机颁发,并且位于受信任的根证书颁发机构内:
The certificate is issued by localhost and is within Trusted Root Certification Authorities:
顺便说一句,我遵循此线程为我的网站颁发证书:在Visual Studio中启用SSL
Btw I followed this thread to issue the certificate for my website: Enable SSL in Visual Studio
推荐答案
可能是因为它未安装在Trusted Root Certification Authorities
中.
It is probably because it is not installed in Trusted Root Certification Authorities
.
通过启动mmc.exe
解决此问题.
然后转到:
文件->添加或删除管理单元->证书->添加->计算机帐户->本地计算机
File -> Add or Remove Snap-ins -> Certificates -> Add -> Computer account -> Local computer
展开Personal
文件夹,您将看到localhost
证书:
Expand the Personal
folder and you will see your localhost
certificate:
将此复制到Trusted Root Certification Authorities - Certificates
最后一步是打开Internet Information Services (IIS) Manager
或仅打开inetmgr.exe
.从那里转到您的站点,选择Bindings...
和Add...
或Edit...
.设置https
并从下拉列表中选择您的证书.
The final step is to open Internet Information Services (IIS) Manager
or simply inetmgr.exe
. From there go to your site, select Bindings...
and Add...
or Edit...
. Set https
and select your certificate from the drop down.
您的证书现已受信任:
原始答案:
https://stackoverflow.com/a/48790088/3850405
这篇关于在本地IIS上启用SSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!