CartoDB / carto-python

CARTO Python client
https://carto.com
BSD 3-Clause "New" or "Revised" License
154 stars 62 forks source link

Fix requests for invalid certificates #59

Closed josemazo closed 7 years ago

josemazo commented 7 years ago

Hi!

We are having some problems with this library in OnPremise CARTO instances with invalid certificates and without the chance of use http, only https.

For fixing this, the APIKeyAuthClient class should have a verify (or something like that) attribute that refers to the verify parameter in requests. We'll need to propagate this change to BasicAuthClient, also for setting the using of the verify parameter in the send method.

We can do that couple of PRs, but we need to now why you convert every boolean to a string here, because the verify parameter needs to be a boolean.

Regards.

alrocar commented 7 years ago

Hi!

the boolean to string conversion was because of this issue but yes, I think that's not the right place to do it since it's breaking the boolean support in requests

Let me see how to fix that without breaking anything. You can assume the boolean conversion will not exist in case you want to provide the PRs (will be very appreciated BTW ;) )

Thanks!

alrocar commented 7 years ago

Currently preparing a PR for this

josemazo commented 7 years ago

Awesome, we'll check it and prepare the code for inserting the verify parameter in another PR(s).

alrocar commented 7 years ago

Thanks but it's not necessary, everything comes in #60

Do you mind reviewing?

alrocar commented 7 years ago

BTW I found a workaround, it's not necessary to wait for the next release, just pass a proper session instance to the auth client:

import requests
session = requests.Session()
session.verify = False

APIKeyAuthClient(the_url, the_api_key, session=session)

Hope it helps!