At the moment I have a web app that works in developer mode, but I am trying to make it work with a self-signed certificate in a Linux Web App in Azure. I have already uploaded the .pfx file to Azure and loaded it into the container by setting the WEBSITE_LOAD_CERTIFICATES application setting. At first, I tried using the store, however, this does not work in Linux.
Instead, I have already been able to find the file where it is uploaded (to a .p12 file), however, when I try to load the certificate manually I get the error error:23076071:PKCS12 routines:PKCS12_parse:mac verify failure which seems to be a problem with the password, but I have verified the password is correct multiple times.
A post here has the method of generating the self-signed keys using openssl, and shows the same issue.
Note: Loading the certificate works on both Windows and Ubuntu, just not in the Linux Web App in Azure.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
In order to get around this, I used the certificate created through azure with the “Create App Service Managed Certificate” option. The password supplied when loading the certificate is just an empty string (“”).
Method 2
For me the solution of an IdentityServer4 hosted on linux in azure was in this Github Issue: https://github.com/IdentityServer/IdentityServer4/issues/4000
The method AddApiAuthorization() overwrites the AddSigningCredential()!
Furthermore you have to specify the IssuerUrl:
services.AddIdentityServer(options =>
{
options.IssuerUri = "https://your.azurewebsites.net/";
})
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0