geier / pycarddav

DEPRECATED - use vdirsyncer & khard -- easy to use CLI CardDAV client
http://lostpackets.de/pycarddav
MIT License
98 stars 35 forks source link

Support for Google's CardDAV #62

Closed geier closed 10 years ago

geier commented 11 years ago

https://developers.google.com/google-apps/carddav/

goodevilgenius commented 11 years ago

I was wondering if this is currently possible.

I tried to do it with the following settings:

user: <my google user name>
password: <google password>
resource: https://www.googleapis.com/carddav/v1/principals/<gmail address>/lists/default

But when I tried pycardsyncer, all it returned was:

CRITICAL:root:While syncing account "google" an error occured:
  [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
geier commented 11 years ago

Google doesn't work yet, because it uses OAauth2 for authenticating. The error you are seeing has nothing to do with that. It looks like the ssl library cannot load an ssl cert. What did you set 'verify' in pycard.conf to?

goodevilgenius commented 11 years ago

I left it commented out.

geier commented 11 years ago

while it doesn't really matter as long as oauth2 isn't support, there probably is still a bug either in pycarddav or in requests. Could you therefore tell me what OS you are on and which version of python and requests you are using? If so, just execute these lines:

import platform import requests import sys

print platform.platform() print 'python:', sys.version print 'requests:', requests.version

and please run pycardsyncer again with the --debug option and paste the output here as well.

Thanks!

goodevilgenius commented 11 years ago

I'm on Ubuntu Linux 12.04.

The output of those commands is:

Linux-3.5.0-28-generic-x86_64-with-Ubuntu-12.10-quantal
python: 2.7.3 (default, Sep 26 2012, 21:51:14) 
[GCC 4.7.2]
requests: 1.1.0

And pycardsyncer --debug returns:

DEBUG:root:Using configuration from /home/drj/.config/pycard/pycard.conf
DEBUG:root:Ignoring default:debug in configuration file
DEBUG:root:Using configuration:
DEBUG:root: accounts:
DEBUG:root:     auth: basic
DEBUG:root:     name: google
DEBUG:root:     resource: https://www.googleapis.com/carddav/v1/principals/good.evil.genius@gmail.com/lists/default/
DEBUG:root:     user: goodevilgenius
DEBUG:root:     verify: True
DEBUG:root:     write_support: 
DEBUG:root: debug: True
DEBUG:root: filename: /home/drj/.config/pycard/pycard.conf
DEBUG:root: sqlite:
DEBUG:root:     path: /home/drj/.local/share/pycardabook.db
DEBUG:root: sync:
DEBUG:root:     accounts: set(['google'])
DEBUG:root:start syncing account google
Traceback (most recent call last):
  File "/usr/local/bin/pycardsyncer", line 55, in <module>
    controllers.sync(conf)
  File "/usr/local/lib/python2.7/dist-packages/pycarddav/controllers.py", line 128, in sync
    auth=conf.account.auth)
  File "/usr/local/lib/python2.7/dist-packages/pycarddav/carddav.py", line 99, in __init__
    **self._settings)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 279, in request
    resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 374, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 213, in send
    raise SSLError(e)
requests.exceptions.SSLError: [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
geier commented 11 years ago

thx, I'll try it myself on Ubuntu 12.04. next week, might also be connected to issue #63 or #64

geier commented 10 years ago

closed as won't fix, see issue #92

untitaker commented 10 years ago

See https://github.com/untitaker/vdirsyncer/issues/8