如何将 .crt 证书文件转换为 .pfx [英] How to convert .crt cetificate file to .pfx

查看:230
本文介绍了如何将 .crt 证书文件转换为 .pfx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将从证书提供商处收到的.crt"证书安装到我的 IIS 7.5 服务器.我已经多次尝试通过单击证书"来安装 .crt 文件,它表明它已正确安装.所以我打开IIS,选择我的服务器",打开右侧菜单中的服务器证书",点击完成证书申请",选择我电脑上的.crt证书,点击确定.但是,当我刷新 IIS 时,证书会自动消失.

I want to install the '.crt' certificate I received from a certificate provider to my IIS 7.5 server. I have tried many times to install the .crt file by clicking on the 'certificates', and it states that it is installed correctly. So I open IIS, select "my server", open "server certificate" which is available on the menu on the right side, click "complete certificate request", select the .crt certificate on my computer and click ok. However, when I refresh IIS the certificate disappears automatically.

我们的托管服务提供商提到我需要使用我没有的.pfx"文件.

Our hosting provider mentions that I need to use a '.pfx' file which I do not have.

推荐答案

我已经通过使用以下方法将此 .crt 文件转换为 .pfx 文件解决了这个问题.

I have solved this issue by converting this .crt file into a .pfx file using following method.

要将.crt 转换为.pfx,我们需要托管服务提供商提供的CSA 证书(私钥).以下是转换此内容的步骤:

To convert .crt to .pfx, we need CSA certificate (Private Key) provided by hosting provider. Below are the steps to convert this:

在命令提示符下运行以下命令:
openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt

Run the following command on command prompt:
openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt

openssl pkcs12 -export -out certificate.pfx -inkey privateKey.txt -in certificate.crt -certfile CACert.crt

这里:

Certificate.crt = Your-domain-Name.crt
CACert.crt = NetworkSolutions_CA.crt
certificate.pfx 是生成文件的新名称.
PrivateKey 可以是 .key.txt 格式

Certificate.crt = Your-domain-Name.crt
CACert.crt = NetworkSolutions_CA.crt
certificate.pfx is the new name of generated file.
PrivateKey can be in .key or .txt format

完成此过程后,现在我们有了 certificate.pfx 文件,因此请转到 IIS 管理器中的 IIS 服务器证书.

After completing this process now we have certificate.pfx file so go to IIS Server certificates in IIS Manager.

右侧有一个导入链接按钮,点击它并选择转换后的证书并输入创建.pfx文件时输入的密码并完成该过程.

There is an import link button on right side, click on this and select the converted certificate and enter password which is enter at the time of creation of the .pfx file and complete the process.

现在在 IIS 上选择您的站点并右键单击它,选择编辑绑定"并在新的弹出窗口中选择类型为 https:// 和主机名称"是您的域名和所有其他字段保持原样,单击确定"以完成此过程.

Now select your site on IIS and right click on this, select "Edit Binding" and on the new popup window select type as https:// and "Hosting name" is your domain name and all other field is as it is, click on ok to complete this process.

现在重新启动 IIS,您的证书在您的网站上运行良好.

Now restart IIS and your certificate is working fine with your site.

这篇关于如何将 .crt 证书文件转换为 .pfx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆