Search code examples
sslport

How to configure SSL for port in windows, hold by node.js process?


On my site I opened a socket to a port, and it worked fine until the security certificate expired, and now a security error returns. Therefore I have to install the security certificate for this port.

the port is just a process, not a website.

I found this command:

netsh http add sslcert ipport=0.0.0.0:8000 certhash=0000000000003ed9cd0c315bbb6dc1c08da5e6 appid={00112233-4455-6677-8899-AABBCCDDEEFF}

but I can't find the appid.

I checked the PID and I found 4980 - in the processes this id is node.js.

I looked in registry > HKEY-LOCAL-MACHINE > Software> classes > appid and the node.js is not explicitly written on any key or app name.

how can I find the appid of this process, or bind the SSL to the port another wey?


Solution

  • I found the solution.

    add a security certificate to node.js processes in this way:

    on the IIS> Server name -> Server certificates right click and export the certificate (with password has your node.js docs).

    this will create the file with pfx format.

    then save the file in the cert folder of node.js. for me it was this path: C:\Windows\System32\NodeJS\cert.

    finally restart the program.