Socket IO not working in Production Ubuntu 18.04

Try adding the following line at the top of the frappe/socketio.js file:
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

Be careful though, because it is not a good practice.

Reference: