Closed asirinelli closed 11 years ago
I get
Traceback (most recent call last):
File "/home/cg/.local/bin/pycardsyncer", line 7, in
While there seems to be an error with the location of the ssl cert, this doesn't seem to be it, the _parse_bool_string actually returns True or False (as a bool) if the string is True or Fale.
Here is the bug I have without my patch:
(carddav)antoine@speedy:~/tmp/carddav/pycarddav$ pycardsyncer --debug
DEBUG:root:Using configuration from /home/antoine/.config/pycard/pycard.conf
DEBUG:root:Ignoring default:debug in configuration file
CardDAV password (account Perso):
DEBUG:root:Using configuration:
DEBUG:root: accounts:
DEBUG:root: auth: basic
DEBUG:root: name: Perso
DEBUG:root: resource: https://XXX:443/XXX/
DEBUG:root: user: XXX
DEBUG:root: verify: True
DEBUG:root: write_support:
DEBUG:root: debug: True
DEBUG:root: filename: /home/antoine/.config/pycard/pycard.conf
DEBUG:root: sqlite:
DEBUG:root: path: /home/antoine/.local/share/pycardabook.db
DEBUG:root: sync:
DEBUG:root: accounts: set(['Perso'])
DEBUG:root:start syncing account Perso
Traceback (most recent call last):
File "/home/antoine/tmp/carddav/bin/pycardsyncer", line 55, in <module>
controllers.sync(conf)
File "/home/antoine/tmp/carddav/local/lib/python2.7/site-packages/pycarddav/controllers.py", line 128, in sync
auth=conf.account.auth)
File "/home/antoine/tmp/carddav/local/lib/python2.7/site-packages/pycarddav/carddav.py", line 99, in __init__
**self._settings)
File "/home/antoine/tmp/carddav/local/lib/python2.7/site-packages/requests/sessions.py", line 335, in request
resp = self.send(prep, **send_kwargs)
File "/home/antoine/tmp/carddav/local/lib/python2.7/site-packages/requests/sessions.py", line 438, in send
r = adapter.send(request, **kwargs)
File "/home/antoine/tmp/carddav/local/lib/python2.7/site-packages/requests/adapters.py", line 331, 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
as stated above, while there obviously is an error in the SSL verification, this should have nothing to do with the configuration. Please type these two lines into a python prompt:
import requests requests.get('https://XXX:443/XXX/') # and replace the XXX as above
this should raise the same exception as pycarddav does. If the errors disappears, it is probably pycarddav's fault, otherwise it's probably a problem with requests.
I believe, it is pycarddav fault:
In [3]: requests.get('https://www.monte-stello.com/')
Out[3]: <Response [200]>
It looks like you are right, somewhere pycarddav messes up. But if you look at the Section._parse_bool_string() method, you'll see that it returns True (the Bool) on 'True' (the string) input. As stated above, you're commit breaks the config parser for me. I'll try to find some time on the weekend for this…
this should be fixed in 964c337 (in the develop branch). Please reopen if the bug still occurs. Thx!
In the AccountSection Class, the default for 'verify' option is set to 'True' which is a str type. It should be True which is a bool. If 'verify' is not set in the config file, the str 'True' will be used and pass to the requests module. The consequence will be an SSL error as the 'True' string will be used as certificate location.