updated to use SSL only and give more error messages