Fix Basic Auth for long username/passwords combinations

It was not possible to use Basic Auth with a long username/password combination because base64.encodestring would split the string with '\n' which generates invalid HTTP headers