Socket.io-client: Setting rejectUnauthorized to false is not ignoring certificate error

Created on 29 Mar 2016  路  4Comments  路  Source: socketio/socket.io-client

I've a self signed certificate setup with a different hostname on my server. I get a
WebSocket Error: Network Error 12038, The host name in the certificate is invalid or does not match
on IE.

I tried setting rejectUnauthorized to false but it still gives me the same error.

var wsconnect = socket('https://url', {
  transports: ['websocket'],
  rejectUnauthorized: false
});

Am I doing this right?

Most helpful comment

does this only work on nodejs but not with the client on browser? I can't get it work from browser. Still pop out Error in connection establishment: net::ERR_CERT_AUTHORITY_INVALID in chrome

All 4 comments

@aravindsrivats using process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';

does it works?

does this only work on nodejs but not with the client on browser? I can't get it work from browser. Still pop out Error in connection establishment: net::ERR_CERT_AUTHORITY_INVALID in chrome

Did anyone ever figure this out? Having this problem now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yesterday24 picture yesterday24  路  4Comments

Korri picture Korri  路  8Comments

vadimka123 picture vadimka123  路  6Comments

gtk2k picture gtk2k  路  3Comments

BorntraegerMarc picture BorntraegerMarc  路  4Comments