Fixed reversed error messages
Added simple HTTPS support