fix reversed error messages; added simple HTTPS support