Azure https与pfx文件 [英] Azure https with pfx file

查看:118
本文介绍了Azure https与pfx文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的Azure服务创建 https 端点。我收到了一个 p7b 文件,我将其转换为 cer 文件。从 cer 我可以使用几行c#转换为 pfx

I am trying to create an https endpoint for my azure service. I was given an p7b file that I converted into a cer file. From the cer I was able to convert with a few lines of c# to a pfx.

var cert = new X509Certificate2(@"certpath", "
var bytes = cert.Export(X509ContentType.Pfx, "password");
File.WriteAllBytes(@"certpath\cert.pfx", bytes);

现在当我将证书上传到azure时,一切似乎都没问题,我复制指纹并尝试使用新的指纹升级作为终点的一部分,我在azure中收到错误。

Now when I upload the cert to azure everything seems ok, I copy the thumbprint and try to upgrade with the new thumbprint as part of the end point and I get an error in azure.


证书与与HTTPS输入端点endpointName关联的指纹3FA490D1D4957942CD2ED545F6E823D0008796EA2不包含私钥。

Certificate with thumbprint 3FA490D1D4957942CD2ED545F6E823D0008796EA2 associated with HTTPS input endpoint "endpointName" does not contain private key.


推荐答案

你是否将.p7b转换为.cer?你的问题是cer文件不包含私钥信息,因此当你将它作为pfx导出时,它没有它需要使用的信息SSL。

How did you convert the .p7b to a .cer? You're problem is that cer files don't contain the private key information, so when you exported it as a pfx, it doesn't have the information that it needs to work with SSL.

easi转换为pfx的est方式可能是将证书导入本地计算机(使用certmgr.msc),然后导出它,确保选择是,导出私钥选项。

The easiest way to convert to a pfx is probably to import the certificate onto your local machine (using certmgr.msc), then export it making sure you select the "Yes, export the private key" option.

编辑:经过GregS评论之后做了一些研究,问题仍然是一样的,你是pfx没有它需要的私钥使用SSL,但原因实际上是.p7b文件没有私钥开头。您需要使用其他证书。已经有与服务器故障相关的问题

After doing some more research after GregS' comment, the problem is still the same, you're pfx doesn't have the private key it needs to work with SSL, but the cause is actually that the .p7b file doesn't have a private key to begin with. You need to use a different certificate. There is already a question related to this on server fault.

这篇关于Azure https与pfx文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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