Reputation: 545
I am trying to use godaddy ssl certificates on ec2. But getting this error.
Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
Flow I used.
openssl req -new -newkey rsa:2048 -nodes -keyout foo.com.key -out foo.com.csr
used foo.com.csr to generate the godaddy and got 3 files.
3b8bc5516b18ff0.crt , 3b8bc5516b18ff0.pem and gd_bundle-g2-g1.crt
var privateKey = fs.readFileSync('3b8bc5516b18ff0.pem');
var certificate = fs.readFileSync('3b8bc5516b18ff0.crt');
/**
* And converted gd_bundele to gd0, gd1, gd2
*/
var credentials = {
key: privateKey,
cert: certificate,
ca: [
fs.readFileSync('gd0.crt'),
fs.readFileSync('gd1.crt'),
fs.readFileSync('gd2.crt')
]
};
//http.createServer(app);
var httpsServer = https.createServer(credentials, app);
Upvotes: 0
Views: 760
Reputation: 545
I got the solution .
openssl req -new -newkey rsa:2048 -nodes -keyout foo.com.pem -out foo.com.csr
foo.com.pem should be passed as privatekey.
NOTE : It is important save the key with which the csr was created and sent to the godaddy (I called foo.com.pem).
Upvotes: 0