What I used to generate the key/cert:
openssl req -new -x509 -key localhost.key -out localhost.cert -days 3650 -subj /CN=localhost
server.js: