Node.js and Socket.io - Certificate is invalid -


i'm having trouble connecting chat application node.js server running on ubuntu 16.04. problem seems ssl certificate have been generated using 'letsencrypt'.

i have connected node.js server using openssl certificate - works in chrome browser.

here code node.js part.:

let fs = require('fs'); let https = require('https');  var options = {      key: fs.readfilesync('./file.pem'),      cert: fs.readfilesync('./file.crt') };  let server = https.createserver(options); let io = require('socket.io')(server);  let redis = require('ioredis'); let redis = new redis();  redis.subscribe('all-chat');  redis.on('message', function (channel, message) {     message = json.parse(message);     io.emit(channel + ':' + message.event, message.data); });  server.listen(3201); 

the error code i'm getting browser is.:

net::err_insecure_response 

my guess odd reason certificates have obtained not following standard of sorts, browser discards response.

for can gather around web problem - solution should using certificate 'letsencrypt' and/or multiple variations of.:

var options = { ... }; 

and believe have tried every possible combination.

if open website in 2 windows, 1 in edge , 1 in chrome, can succesfully send message edge chrome - message not shown in edge should.

thanks in advance detail may put me on track!

the answer rather simple. sure can use certificate can use diagnostic tool found on https://www.digicert.com/help/.

for connection client node.js end stated ip on client side - , not when using certificate have been created public domain. changed ip on client side ip public domain , worked!


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -