smogon / pokemon-showdown

Pokémon battle simulator.
https://pokemonshowdown.com
MIT License
4.77k stars 2.79k forks source link

Cannot run showdown with SSL. CRASH: Error: The SSL settings are misconfigured: Error: error:0909006C:PEM routines:get_name:no start line #8799

Closed madamadam-c closed 1 year ago

madamadam-c commented 2 years ago

Hi, I've been trying to run a showdown server and recently I attempted to get SSL to work on it. I have configured it the exact same way as many other people who it works for but I have no luck. I have tried everything and have moved the chain and key to different places, used absolute and relative paths and .. or // or \ or / or String.raw but no matter what I have no luck. Could I please have some assistance? My certificate and private key are completely valid.

This is my config.js file exports.ssl = { port: 443, options: { key: '/etc/letsencrypt/live/pseudo.x/privkey.pem', cert: '/etc/letsencrypt/live/pseudo.x/fullchain.pem', }, };

And this is the log I receive each time I try to launch the site. RESTORE CHATROOM: lobby RESTORE CHATROOM: staff SSL private key config values will not support HTTPS server option values in the future. Please set it to use the absolute path of its PEM file. SSL certificate config values will not support HTTPS server option values in the future. Please set it to use the absolute path of its PEM file.

CRASH: Error: The SSL settings are misconfigured: Error: error:0909006C:PEM routines:get_name:no start line at Object.createSecureContext (_tls_common.js:129:17) at Server.setSecureContext (_tls_wrap.js:1331:27) at Server (_tls_wrap.js:1186:8) at new Server (https.js:70:3) at Object.createServer (https.js:106:10) at new ServerStream (/home/opc/pokemon-showdown-0.11.7/.server-dist/sockets.js:327:29) at RawProcessManager.setupChild [as _setupChild] (/home/opc/pokemon-showdown-0.11.7/.server-dist/sockets.js:541:20) at Immediate._onImmediate (/home/opc/pokemon-showdown-0.11.7/.lib-dist/process-manager.js:752:29) at processImmediate (internal/timers.js:464:21) at new ServerStream (/home/opc/pokemon-showdown-0.11.7/.server-dist/sockets.js:329:36) at RawProcessManager.setupChild [as _setupChild] (/home/opc/pokemon-showdown-0.11.7/.server-dist/sockets.js:541:20) at Immediate._onImmediate (/home/opc/pokemon-showdown-0.11.7/.lib-dist/process-manager.js:752:29) at processImmediate (internal/timers.js:464:21)

monsanto commented 1 year ago

Sorry nobody got to this at the time. I looked at our config.js and we readFileSync the .pem files, so I would guess that key and cert take the file contents and not filenames. Hope this helps.