Site in Azure Websites fails processing of X509Certificate2

前端 未结 6 1159
傲寒
傲寒 2020-12-13 18:09

I have site in Azure Websites (not Hosted Service) and I need processing .pfx certificates with private key there.

var x509Certificate2 = new X509Certificat         


        
6条回答
  •  清歌不尽
    2020-12-13 18:41

    I had exactly the same problem, and struggled many hours for fixing it. In the article that you mention the last stack call is to the function LoadCertFromFile, but in your (and my) case it is LoadCertFromBlob.

    So I looked for LoadCertFromBlob and found this:

    Why does X509Certificate2 sometimes fail to create from a blob?

    The solution was to go in IIS and change the application pool identity from "ApplicationPoolIdentity" to "LocalService", so that the certificate is loaded in right local folder.

提交回复
热议问题