要使用CyberSource服务进行请求,您必须在请求中附加.p12证书.
To do a request with CyberSource service you have to append .p12 certificate in request.
经典的附加方式(CyberSource SDK):
Classic way of appending(CyberSource SDK):
req.ClientCertificates.Add(new X509Certificate2(@"D:\cert\cert.p12", "password1"));这在本地或专用主机上完美运行.
This works perfectly on local or dedicated hosting.
问题是我们需要在Azure上附加.p12证书,这在经典方式中是不可能的.
The issue is we need to append .p12 certificate on Azure, which is impossible in classic way.
我尝试将其放入wwwroot/App_Data并加载,但此后一直无法正常工作,我们得到的服务器错误是:
I've tried to put it in wwwroot/App_Data and load, but it doesn't work since, error from server we get is:
502-Web服务器在充当服务器时收到无效响应网关或代理服务器.您所在的页面有问题寻找,并且无法显示.当Web服务器(同时充当网关或代理)与上游内容服务器联系,它收到了来自内容服务器的无效响应.
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): azure.microsoft/zh-CN/blog/using-certificates-in-azure-websites-applications/
I've read here, how to use cert on azure(changed p12 to pfx and uploaded to Azure): azure.microsoft/en-gb/blog/using-certificates-in-azure-websites-applications/
但是我不确定,这是正确的方法.
But I am not sure, this is correct way.
推荐答案我已通过将证书上传到Azure并将其用作指纹解决了此问题.您必须在web.config中使用指纹才能在网站上使用它.
I've resolved this by uploading certificate to Azure, and use it as a thumbprint. You have to use thumbprint in web.config to have it available on the website.
阅读: azure.microsoft/zh-CN/blog/using-certificates-in-azure-websites-applications/
更多推荐
Azure上的CyberSource
发布评论