When playing in the editor WebSocket connection successful but failed when playing in packaged, why?

I experienced the same issue when packaging on Mac - I resolved it by adding the default cacerts.pem key that comes with UE4’s source to Project Settings > Packaging > Packaging > Additional Non-Assets Directories to Copy