Using secure=True to avoid HTTP 302 errors

This fixes #3