ericvicenti / csr-gen Goto Github PK
View Code? Open in Web Editor NEWGenerates OpenSSL Certificate Signing Requests in node.js
License: MIT License
Generates OpenSSL Certificate Signing Requests in node.js
License: MIT License
Am I missing something? In order to spin-up an HTTPS server, I would do something like this:
var privateKey = fs.readFileSync('privatekey.pem').toString();
var certificate = fs.readFileSync('certificate.pem').toString();
var server = https.createServer({key: privateKey, cert: certificate});
server.listen(8000);
To generate the key, csr, and cert I would run commands like this:
openssl genrsa -out privatekey.pem 2048
openssl req -new -key privatekey.pem -out certrequest.csr -subj "/C=US/ST=California/L=San Fransisco/O=Loadtester/OU=Operations/CN=konsumer-mac.local/[email protected]"
openssl x509 -req -in certrequest.csr -signkey privatekey.pem -out certificate.pem
For a similar approach with your module:
csrgen(os.hostname(), {
outputDir: __dirname,
read: true,
company: 'Loadtester',
email: '[email protected]'
}, function(err, keys){
if (err) throw(err);
var server = https.createServer({key: keys.private, cert: NOCERT});
});
This lib does only the first 2 parts of the SSL signing process: generate a private key, and generate a csr. Am I doing this wrong, or is it just missing the functionality to actually make a cert? Would it be possible to use crypto
to do all this, for a 100% native approach, so openssl command-line util is not needed?
From the test snippet. The private key is generated but CSR file is undefined. Am I missing anything here?
I use Node 0.10.24 and i dont get the key in the callback.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.