Michael Ballbach
unread,Jun 24, 2009, 12:15:43 PM6/24/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.