我正在使用OpenSSL来避免付费 . 在我的服务器上运行IIS 8和Windows Server 2012 .
我这样创建了我的证书:
-
使用IIS创建证书请求
-
使用以下命令创建RSA私钥
openssl genrsa -des3 -out cakey.pem 2048
- 之后,我使用此命令生成证书
openssl req -new -key cakey.pem -x509 -days 1825 -extensions v3_ca -out ca.crt
- 最后我使用以下方式签署了证书申请:
openssl x509 -req -days 365 -in certreq.txt -CA ca.crt -CAkey cakey.pem -CAcreateserial -out iis.cer
但是当我导航到网站时,我收到“错误”,告诉我这是一个“不受信任的证书”:本网站提供的安全证书不是由受信任的证书颁发机构颁发的 .
2 回答
您从OpenSSL工具获得的是自签名证书 . 当然,任何浏览器都不信任它,因为谁能说你值得信任 .
如果您想 Build 公共网站,请购买证书 . 这是你必须支付的东西,就像公共域名一样 .
相反,如果您要为公司托管内部网站,则可以通过多种方式设置自己的CA,例如使用Microsoft Active Directory证书服务 .
Updated in 2018: Today there are more options to get free certificates, such as Let's Encrypt. Check them out and make good use of them.
在尝试访问运行在CA层次结构下生成的证书的IIS服务器之前,您是否已将CA证书安装到浏览器中?这是一些information about that step .