SSL

5 views
Skip to first unread message

Michael Ballbach

unread,
Jun 24, 2009, 12:15:43 PM6/24/09
to GData Python Client Library Contributors
I've just started toying around with the gdata modules for getting
access to calendar data, and I was trying to get it to use ssl. I put
'service.ssl = True' the app I was using and this got it to partially
request its data over https instead of http, but not all the way. For
calendars specifically this is because CalendarEventQuery specifies
the 'mode' there in its URI.

So I made a trivial change to atom.Service:

--- ../src/atom/service.py 2009-06-05 14:17:08.000000000 -0400
+++ ../../../lib/python2.6/site-packages/atom/service.py 2009-06-24
11:55:11.954211092 -0400
@@ -145,7 +145,9 @@
def request(self, operation, url, data=None, headers=None,
url_params=None):
if isinstance(url, (str, unicode)):
- if not url.startswith('http') and self.ssl:
+ if url.startswith('http:') and self.ssl:
+ url = atom.url.parse_url('https:' + url[5:])
+ elif not url.startswith('http') and self.ssl:
url = atom.url.parse_url('https://%s%s' % (self.server, url))
elif not url.startswith('http'):
url = atom.url.parse_url('http://%s%s' % (self.server, url))

and this made it respect my .ssl setting for all requests. I don't
know if this is a good fix - the unit tests seem somewhat broken, or
more likely I just don't know how to run them, so I thought I'd post
this to get feedback about it. I would like ssl to work generally - if
there's more work that needs to be done here I would be willing to
track it down.

Thanks.

Jeff S (Google)

unread,
Jun 29, 2009, 1:01:39 PM6/29/09
to GData Python Client Library Contributors
Hi Michael,

Thanks for the patch, this looks good. I was just wondering if you've
signed a contributor license agreement which we require for this
library. The process should be straightforward, more details here:

http://code.google.com/p/gdata-python-client/wiki/BecomingAContributor

Happy coding,

Jeff

Michael Ballbach

unread,
Jun 30, 2009, 5:37:34 PM6/30/09
to GData Python Client Library Contributors
I just signed the electronic one, though I used my rten.net email
address, which is what I use primarily, as opposed to the one I post
on here with, if that matters. Thanks for getting back to me.

Jeff S (Google)

unread,
Jul 10, 2009, 4:14:48 PM7/10/09
to GData Python Client Library Contributors
Thanks Michael,

I just checked this in so it will be in the next release.

Cheers,

Jeff
Reply all
Reply to author
Forward
0 new messages