Rantanen / node-mumble

Mumble client in Node.js
MIT License
155 stars 48 forks source link

private and public #67

Closed demipixel closed 8 years ago

demipixel commented 8 years ago

Silly question, what options/command should be used to generate the public.pem and private.pem? I've looked through https://nodejs.org/api/tls.html and have still run into issues (such as:

c.context.setCert(options.cert); ^ Error: error:0906D06C:PEM routines:PEM_read_bio:no start line )

Prior99 commented 8 years ago

I use this in my startup script.

        openssl genrsa -out bot.key 2048
        openssl req -new -sha256 -key bot.key -out bot.csr -subj "/"
        openssl x509 -req -in bot.csr -signkey bot.key -out bot.cert
Rantanen commented 8 years ago

You don't need to generate the certificate signing request individually. You can combine both of these into one with:

openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out certificate.pem

For convenience you can also write both the private key and the signed certificate in the same file:

openssl req -x509 -newkey rsa:2048 -nodes -keyout mumble.pem -out mumble.pem

If you want to protect the key with a pass phrase, you can leave the -nodes option out.

demipixel commented 8 years ago

Works perfectly, thanks!

tjhorner commented 8 years ago

That's useful. Perhaps it should be in the README instead of just saying "here's the page go figure it out"? Would be more node-beginner friendly...