litl / rauth

A Python library for OAuth 1.0/a, 2.0, and Ofly.
http://readthedocs.org/docs/rauth/en/latest/
MIT License
1.6k stars 174 forks source link

Allow use of HTTPS with verify=False #21

Closed r1chardj0n3s closed 12 years ago

r1chardj0n3s commented 12 years ago

I would love to use rauth but cannot because the HTTPS server I'm accessing doesn't have a verifiable SSL cert. I need to be able to tell requests to not verify the SSL cert.

maxcountryman commented 12 years ago

This should definitely be fixed. Thanks for pointing this out!

On Jul 25, 2012, at 22:59, Richard Jonesreply@reply.github.com wrote:

I would love to use rauth but cannot because the HTTPS server I'm accessing doesn't have a verifiable SSL cert. I need to be able to tell requests to not verify the SSL cert.


Reply to this email directly or view it on GitHub: https://github.com/litl/rauth/issues/21

maxcountryman commented 12 years ago

I believe this should work via passing in verify=False on your request assuming you're using one of the service wrappers. So for instance, in the case of any service wrapper:

service.get('https://example.com', verify=False)

Let me know if this doesn't work. Also note that any Requests options may be passed through directly to Requests. I've tried to ensure that we engage Requests as naturally as possible so that the Requests's API is fully exposed.

r1chardj0n3s commented 12 years ago

This does not work for all of the API (get_request_token, get_access_token.)

maxcountryman commented 12 years ago

This should work for those methods as well. The kwargs are passed directly through to Requests: https://github.com/litl/rauth/blob/master/rauth/service.py#L489

So if you do something like:

service.get_request_token(verify=False)

That should tell Requests to handle things properly. If you're still having issues please let me know. It's possible that it's not being passed back correctly or there's an issue at the Request's level.

r1chardj0n3s commented 12 years ago

Chalk up 1 brainfart on my part. I tried it; it didn't work. I just tried it again and it works fine. Sorry for the noise!

ps. http://wiki.python.org/moin/PyPiOauth "Alternative rauth Implementation" :-)

maxcountryman commented 12 years ago

Not a problem, glad to have helped! That's an interesting project btw, didn't know it existed. (I think Requests mainline has corrected that particular issue they were patching so maybe moot at this point?)

r1chardj0n3s commented 12 years ago

That wiki page was written by me just now, and I have a pull request against requests to fix the parameters issue :-)

maxcountryman commented 12 years ago

Oh I see. Looks great!