2

I'm facing a problem with SSL integration with node.js when i integrating certificate and restart the server it shows error:0906d06c:pem routines:pem_read_bio:no start line Godaddy SSL certificate

I'm using this code:

const https = require('https');   
const fs = require('fs');

var key=fs.readFileSync(__dirname+'/../ssl/sslforfree_private.key','utf8');  
var cert= fs.readFileSync(__dirname + '/../ssl/sslforfree_certificate.crt','utf8');    
var credentials = {key: key, cert: cert};  
var port = normalizePort(process.env.PORT || '4000');
app.set('port', port);

var server = https.createServer(credentials,app);
user2653663
  • 2,818
  • 1
  • 18
  • 22
  • I already did it on another project by the same the difference is this project is deployed on aws ec2 linux environment and the success one is deployed on ubuntu server – Sanjay Kumar May 14 '19 at 08:13
  • 1
    I just fix it by saving private.key file as utf-8(without BOM).that works now – Sanjay Kumar May 14 '19 at 09:45

0 Answers0