Pem library is not supporting in azure function, How we can dynamically generate self signed certificate (x.509) using node js

brija 1 Reputation point
2020-07-28T11:19:50.603+00:00

i am using pem library in node js code to generate the device and root certificate(self signed X.509 certificate) it is working in local but when are deploying the same on web app it is throwing an error. even we have tried the same with azure function as well, we are getting error.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,345 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,591 Reputation points Microsoft Employee
    2020-07-28T15:59:29.343+00:00

    It is likely that the module you are using is depending on a native library. For example, pem is a wrapper around the openssl executable which will fail if it's not available in the path.

    If this is the case, you could use a pure js library like forge which has no such native dependencies. It is capable of generating self-signed certificates as well.