Azure 上的网络资源

CyberSource on Azure

要使用 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 上使用证书(将 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/