lonalore / nodejs

e107 (v2) plugin - It provides an API that other plugins can use to add realtime capabilities to e107 (v2), specifically enabling pushing updates to open connected clients.
GNU General Public License v2.0
2 stars 4 forks source link

Error when setting HTTPS #5

Open nesjett opened 5 years ago

nesjett commented 5 years ago

Node doesnt starts when setting scheme to 'https'

lonalore commented 5 years ago

That's very little information. Can you provide me more details? URL for your website, errors on console etc...

nesjett commented 5 years ago

Sorry, I just wanted to know if it´s a known issue.

Config: scheme: 'https', port: 8000, host: 'domain', resource: '/socket.io', serviceKey: '', backend: { port: 80, host: 'domain', scheme: 'https', basePath: '', // If your e107 is in a subfolder, use this syntax: /my_folder messagePath: '/e107_plugins/nodejs/nodejs.php' . . .

Console error: ` fs.js:667 return binding.open(pathModule.toNamespacedPath(path), ^

Error: ENOENT: no such file or directory, open '' at Object.fs.openSync (fs.js:667:18) at Object.fs.readFileSync (fs.js:572:33) at Object. (/var/www/vhosts/domain/httpdocs/e107_plugins/nodejs/server.js:1548:11) at Module._compile (module.js:649:30) at Object.Module._extensions..js (module.js:660:10) at Module.load (module.js:561:32) at tryModuleLoad (module.js:501:12) at Function.Module._load (module.js:493:3) at Function.Module.runMain (module.js:690:10) at startup (bootstrap_node.js:194:16) `

lonalore commented 5 years ago

You should also provide .key, .crt and .bundle files for your SSL, like:

sslKeyPath: '/var/www/clients/client2/web2/ssl/e107hungary.org-le.key',
sslCertPath: '/var/www/clients/client2/web2/ssl/e107hungary.org-le.crt',
sslCAPath: '/var/www/clients/client2/web2/ssl/e107hungary.org-le.bundle',
nesjett commented 5 years ago

Thank you, I missed this part, only forced redirection to https.

Anyway I´m not confortable with certs at all, Ive copied the cert keys into files with the right extension and configured it, but its not working at all (works partially)

Some things works, like node chatbox, but PM (that worked right in http mode) is not working now. I get some errors on login to, like:

Error with authenticate client request: { Error: write EPROTO 140335337731904:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:827:

at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPROTO', code: 'EPROTO', syscall: 'write' }

getNodejsSessionIdsFromUid { uid: undefined, sessionIds: [ 'K_dlxHbuDh8giVJ_AAAA',