Secure hub

From what I understand of what you explained HUB does, this should address your SSL problem on hosted.

Closes #619 since it also contains those patches