Use SSL WebSockets for SSL applications. Fixes #2674.