Https set-up error

Hello there, can you help me with setting up Https for Node Red please. Thank you.

Here's the error:

Starting as root systemd service.
Error loading settings file: /home/yuxiang/.node-red/settings.js
Error: ENOENT: no such file or directory, open '~/.node-red/privkey.pem'

the settings.js file is here:

//https object:
https: {
	key: require("fs").readFileSync('~/.node-red/privkey.pem'),
	cert: require("fs").readFileSync('~/.node-red/cert.pem')
},
requireHttps: true,

Those files do not exist at that location (that is what the error message says).

Hi Bakman2,

Thanks for your response.

You are right, but the weird thing is that the "privkey" file does exist in the specified location.

Any further guidance will be much appreciated.

@knolleary

Perhaps no read permissions for node-red ?

2 Likes

what user does ~ refer to ? Maybe use the full path instead.

1 Like

You cannot use ~ in the path - that is a shell expansion that Node.js doesn't know anything about.

3 Likes

issue solved, thank you so much folks :grinning:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.