geier / pycarddav

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

authentication with Lion Server #63

Closed jasonehines closed 10 years ago

jasonehines commented 11 years ago

Can anyone tell me why I'm getting 403 errors trying to connect to Lion Server

this is from my config file: resource: https://servername.com/addressbooks/users/username/addressbook/ auth: digest

this is the message I'm getting:

root@incrediblepbx:~/pyCardDAV-0.4.1/bin# pycardsyncer Traceback (most recent call last): File "/usr/local/bin/pycardsyncer", line 5, in pkg_resources.run_script('pyCardDAV==0.4.1', 'pycardsyncer') File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script execfile(script_filename, namespace, namespace) File "/usr/local/lib/python2.7/dist-packages/pyCardDAV-0.4.1-py2.7.egg/EGG-INFO/scripts/pycardsyncer", line 88, in controllers.sync(conf) File "/usr/local/lib/python2.7/dist-packages/pyCardDAV-0.4.1-py2.7.egg/pycarddav/controllers.py", line 124, in sync auth=conf.dav__auth) File "/usr/local/lib/python2.7/dist-packages/pyCardDAV-0.4.1-py2.7.egg/pycarddav/carddav.py", line 97, in init response.raise_for_status() #raises error on not 2XX HTTP status code File "/usr/local/lib/python2.7/dist-packages/requests-1.2.3-py2.7.egg/requests/models.py", line 683, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden

geier commented 11 years ago

try https://github.com/k8n/pycarddav/ for some calendar server fixes. Please report back if it works.

jasonehines commented 11 years ago

downloaded that and ran the setup script. This is what I get when I run pycardsyncer:

root@incrediblepbx:~/pycarddav-master/bin# pycardsyncer Traceback (most recent call last): File "/usr/local/bin/pycardsyncer", line 5, in pkg_resources.run_script('pyCardDAV==0.4.1', 'pycardsyncer') File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script execfile(script_filename, namespace, namespace) File "/usr/local/lib/python2.7/dist-packages/pyCardDAV-0.4.1-py2.7.egg/EGG-INFO/scripts/pycardsyncer", line 88, in controllers.sync(conf) File "/usr/local/lib/python2.7/dist-packages/pyCardDAV-0.4.1-py2.7.egg/pycarddav/controllers.py", line 126, in sync ssl_version=ssl.PROTOCOL_SSLv3 if conf.dav__SSLv3 else None) File "/usr/local/lib/python2.7/dist-packages/pyCardDAV-0.4.1-py2.7.egg/pycarddav/carddav.py", line 105, in init self.session.mount('https://', PyCardDAV.SSLAdapter(ssl_version=ssl_version)) File "/usr/local/lib/python2.7/dist-packages/pyCardDAV-0.4.1-py2.7.egg/pycarddav/carddav.py", line 83, in init super(PyCardDAV.SSLAdapter, self).init(kwargs) File "/usr/local/lib/python2.7/dist-packages/requests-1.2.3-py2.7.egg/requests/adapters.py", line 81, in init self.init_poolmanager(pool_connections, pool_maxsize, block=pool_block) TypeError: init_poolmanager() got an unexpected keyword argument 'block'

k8n commented 11 years ago

FYI some hacking is required to get Lion to work for you: https://github.com/geier/pycarddav/pull/51

Sincerely,

Konstantin

On 2013-06-07, at 12:27, Jason Hines notifications@github.com wrote:

downloaded that and ran the setup script. This is what I get when I run pycardsyncer:

root@incrediblepbx:~/pycarddav-master/bin# pycardsyncer Traceback (most recent call last): File "/usr/local/bin/pycardsyncer", line 5, in pkg_resources.run_script('pyCardDAV==0.4.1', 'pycardsyncer') File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script execfile(script_filename, namespace, namespace) File "/usr/local/lib/python2.7/dist-packages/pyCardDAV-0.4.1-py2.7.egg/EGG-INFO/scripts/pycardsyncer", line 88, in controllers.sync(conf) File "/usr/local/lib/python2.7/dist-packages/pyCardDAV-0.4.1-py2.7.egg/pycarddav/controllers.py", line 126, in sync ssl_version=ssl.PROTOCOL_SSLv3 if conf.dav__SSLv3 else None) File "/usr/local/lib/python2.7/dist-packages/pyCardDAV-0.4.1-py2.7.egg/pycarddav/carddav.py", line 105, in init self.session.mount('https://', PyCardDAV.SSLAdapter(ssl_version=ssl_version)) File "/usr/local/lib/python2.7/dist-packages/pyCardDAV-0.4.1-py2.7.egg/pycarddav/carddav.py", line 83, in init super(PyCardDAV.SSLAdapter, self).init(kwargs) File "/usr/local/lib/python2.7/dist-packages/requests-1.2.3-py2.7.egg/requests/adapters.py", line 81, in init self.init_poolmanager(pool_connections, pool_maxsize, block=pool_block) TypeError: init_poolmanager() got an unexpected keyword argument 'block'

— Reply to this email directly or view it on GitHub.

geier commented 11 years ago

what version of requests are you using?

on another note: have you tried another CardDAV client? Does it work with them? The 403 error sounds like you may not be using the right credentials or url.

jasonehines commented 11 years ago

I'm running 1.2.3

I can connect to it from the contacts app. Also if I browse to the URL in safari it shows all the vCard files.

Thank You,

Jason Hines Hines Network

On Jun 10, 2013, at 9:05 AM, Christian Geier notifications@github.com wrote:

what version of requests are you using?

on another note: have you tried another CardDAV client? Does it work with them? The 403 error sounds like you may not be using the right credentials or url.

— Reply to this email directly or view it on GitHubhttps://github.com/geier/pycarddav/issues/63#issuecomment-19197097 .

geier commented 11 years ago

hmm, sorry I can't help you at the moment. I'll need to set up CalendarServer myself, but I'll probably go for a newer version. If you could give me access to an account on your server I might be able to fix it. See lostpackets.de/pycarddav/ for my email address.

geier commented 11 years ago

please try the develop branch, perhaps that bug is fixed there…

jasonehines commented 11 years ago

I've downloaded the developer branch. Do I need need to build (not sure if that's the correct term) it or something?

Sorry for my ignorance

jasonehines commented 11 years ago

I sent you an email with a log in for my server if you want to try to make it work. Thanks so much for your help

geier commented 11 years ago

just execute python setup.py install in the unpacked directory.

jasonehines commented 11 years ago

I finally got it to work with 0.5.0.2 if I don't verify ssl. It's not super critical since this will all be behind a firewall, but here's the error I was getting:

[Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib

Thanks for your help

geier commented 11 years ago

It looks like the ssl library cannot load an ssl cert. What did you set 'verify' in pycard.conf to?

jasonehines commented 11 years ago

When I got that error it was still commented out. To make it work I had to set it to False.

On Jun 19, 2013, at 5:21 AM, Christian Geier notifications@github.com wrote:

It looks like the ssl library cannot load an ssl cert. What did you set 'verify' in pycard.conf to?

— Reply to this email directly or view it on GitHub.

geier commented 11 years ago

this is less than ideal, can you do this (in python)

import requests resp = requests.get('https://server.tld/your/resoucre/here/')

and post the output?

jasonehines commented 11 years ago

maybe I did something wrong, but I got no output:

root@incrediblepbx:~# python Python 2.7.3 (default, Jan 13 2013, 11:20:46) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import requests resp = requests.get('https://office.hinesnetwork.com/addressbooks/users/jasonehines/addressbook/')

geier commented 11 years ago

no, I guess you did nothing wrong, but it's strange if you get no ssl error here, but pycarddav only works with verify=False

geier commented 10 years ago

this should be fixed in 964c337 , please reopen if the bug persists.