Before writing this question I have gone through a lot of questions and answers but I can't seem to find a solution. What I'm trying to do is host an application as a Azure App Service that needs to make a call to the Swish API.
Please see this thread for how my implementation runs locally which works fine:
System diagnostics log from Azure:
I have tried the solutions from Microsoft forums and SO but none seem to do the trick:
//Tested both, none of them work
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
//ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11
Since a lot of the questions are based on accessing an external service and not sending a client certificate the complexity rises a bit as well.
What I have done is in the SSL certificates tab on Azure import the Test certificate. Since .p12 and .pfx are both PKCS #12 files I just renamed the .p12-file. The application runs as B1 Basic App Service Plan so most functionality should be present.
https://stackoverflow.com/a/6821061/3850405
I have also tried this guide to add the certificate to the certificate store in Azure -> Application settings -> App Settings:
https://azure.microsoft.com/en-us/blog/using-certificates-in-azure-websites-applications/
When this did not work I tried to add WEBSITE_LOAD_CERTIFICATES to appSettings in my application but it resulted in a HTTP 503.
Swish certificate and English guide:
https://www.getswish.se/content/uploads/2015/06/Guide-Testverktyg_20151210.zip