问题
I uploaded a .pfx certificate to my function app. How do I load this certificate so I can use it in my Nodejs code? If I put it in the project directory I am able to use it and it works fine but I would like to avoid to have it in the project.
Thanks.
回答1:
In Azure portal, you can follow the figures below to upload your private certificate .pfx file and next to do the SSL binding.
Fig 1. Select your Function App and move to Platform features tab to click SSL button.
Fig 2. Then, select Private Certificates (.pfx) tab to click Upload Certificate
button and next to upload your .pfxfile in the right dialog window.
Fig 3. Move to Bindings tab and click Add SSL Binding button to select your uploaded cert in the right dialog window.
Then, you can refer to the offical document Configure TLS mutual authentication for Azure App Service to know how to configure and enable SSL authenticatication feature in your Node.js code, see its Node.js sample.
There are other offical documents also may helps.
- Use an SSL certificate in your application code in Azure App Service
- Tutorial: Bind an existing custom SSL certificate to Azure App Service
- Buy and configure an SSL certificate for Azure App Service
来源:https://stackoverflow.com/questions/56327847/use-ssl-certificate-in-azure-function-app-with-nodejs