0

Sorry for this question because i am not much familiar with nodejs basically i want to run my chat application on my https server but it will showing error net::ERR_INSECURE_RESPONSE so for this we need original certificate and key or we need self created certificate ?

var app = require('express')();
var fs = require('fs');
var forceSsl = require('express-force-ssl');

app.use(forceSsl);
var options = {
    key: fs.readFileSync('server.key'),
    cert: fs.readFileSync('server.crt')
};
var server = require('https').createServer(options, app).listen(3000,function(){
        console.log("Https server started on port 3000");
});
var io = require('socket.io').listen(server);

So what is my main question is do we need original server.key and server.crt file or we need to create by own ?

0

1 Answer 1

0

A TLS server always requires a certificate except for certain very unusual configurations which don't generally apply to HTTPS.

Sign up to request clarification or add additional context in comments.

3 Comments

in that what should i need to do ?
Err, get a server certificate? and install it? Don't use self-signed certificates, they're not worth the paper they're printed on.
server certificate is already installed on my server this problem is occur in my socket.io request

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.