ssl - 带有 pfx 文件的 Azure https

标签 ssl https azure ssl-certificate

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

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

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

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

最佳答案

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

转换为 pfx 的最简单方法可能是将证书导入到本地计算机上(使用 certmgr.msc),然后将其导出,确保选择“是,导出私钥”选项。

<小时/>

编辑:在 GregS 的评论后做了更多研究后,问题仍然是一样的,你的 pfx 没有使用 SSL 所需的私钥,但原因实际上是 .p7b 文件一开始就没有私钥。您需要使用不同的证书。已经有question related to this on server fault .

关于ssl - 带有 pfx 文件的 Azure https,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6699415/

相关文章:

php - 从 HTTP 自动切换到 HTTPS 的最佳实践是什么

java - Json 遇到意外字符 'q'

windows - 在 Windows 上为 Apache Bench 添加 https 支持

https - 从多个线程使用 libcurl - 如何获得最佳性能?

sql-server - Azure SQL - 使用弹性数据库查询从另一个数据库查询现有表

azure - 备份 Microsoft Azure 虚拟机

ubuntu - Nginx 将 http 子域重定向到 https

google-app-engine - 在 Google App Engine 中添加新的 SSL 证书

php - 回调 API 服务需要什么才能通过 SSL 连接到我的服务器?

azure - 通过互联网(公共(public)IP地址)访问带有Ubuntu操作系统的Neo4j服务器?