I am running an https server using a certificate which was created using a self-signed CA certificate.
Now I want to connect Socket.io client to the Socket.io server
four years later but for any finding this post like me if you need to force client socket to not reject a self-signed server cert you need  rejectUnauthorized: false
as in
const socket = require('socket.io-client')('https://192.168.0.31', { transports: ['websocket'], rejectUnauthorized: false })
from https://github.com/socketio/engine.io-client#methods
also there is now a good source for free certs so now you don't even have to be "cheap d*ck" https://letsencrypt.org/