c# - Azure 上的 Cyber​​Source

标签 c# .net azure ssl x509certificate

要使用 Cyber​​Source 服务发出请求,您必须在请求中附加 .p12 证书。

经典的附加方式(Cyber​​Source SDK):

    req.ClientCertificates.Add(new X509Certificate2(@"D:\cert\cert.p12", "password1"));

这在本地或专用托管上完美运行。

问题是我们需要在 Azure 上附加 .p12 证书,这在传统方式中是不可能的。

我尝试将其放入 wwwroot/App_Data 并加载,但它不起作用,因为我们从服务器得到的错误是:

502 - Web server received an invalid response while acting as a gateway or proxy server. There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.

我已阅读此处,如何在 azure 上使用 cert(将 p12 更改为 pfx 并上传到 Azure): https://azure.microsoft.com/en-gb/blog/using-certificates-in-azure-websites-applications/

但我不确定这是正确的方法。

最佳答案

我已通过将证书上传到 Azure 并将其用作指纹来解决此问题。您必须在 web.config 中使用指纹才能在网站上使用它。

阅读此内容: https://azure.microsoft.com/en-gb/blog/using-certificates-in-azure-websites-applications/

关于c# - Azure 上的 Cyber​​Source,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32759181/

相关文章:

C# 机器人/硬件

c# - 如何在 C# 中从 sql 中检索特定数据?

c# - 使用编码从 XML 字符串中获取字节数组

c# - 使用 ReliableSqlConnection 和 Azure 的工作示例

azure - 获取-AzDenyAssignment : 'directoryObjectId' cannot be null

c# - 根据路径将文件节点添加到树中

c# - Automapper 枚举到枚举类

c# - 为什么 Thread.Sleep( ... ) 避免 CPU 使用基于多线程 Windows 服务的应用程序的 100% 重执行?

c# - 如何使方法的返回类型通用?

azure - 如何使用 Terraform 为 Azure API 管理服务创建用户名密码身份?