Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

c# - CyberSource on Azure

To do a request with CyberSource service you have to append .p12 certificate in request.

Classic way of appending(CyberSource SDK):

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

This works perfectly on local or dedicated hosting.

The issue is we need to append .p12 certificate on Azure, which is impossible in classic way.

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 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.

I've read here, how to use cert on azure(changed p12 to pfx and uploaded to Azure): https://azure.microsoft.com/en-gb/blog/using-certificates-in-azure-websites-applications/

But I am not sure, this is correct way.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

Read this: https://azure.microsoft.com/en-gb/blog/using-certificates-in-azure-websites-applications/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...