etesync / etesync-dav

This is a CalDAV and CardDAV adapter for EteSync
https://www.etesync.com
GNU General Public License v3.0
285 stars 45 forks source link

Issue adding CalDAV user on macOS #270

Open definelicht opened 1 year ago

definelicht commented 1 year ago

Following the macOS instructions, I'm trying to add my CalDAV user, but getting "Unable to verify account name or password". I'm running etesync-dav 0.31.2.

Interestingly, adding the CardDAV using the provided instructions "worked" (the account was added to macOS), although it does not seem to sync anything (the list of contacts is empty).

A screenshot of my configuration and the error:

add_caldav

Accessing the web interface through https://localhost:37358 works, and logging in with the same username and password as I'm trying to add to macOS also works: webui (all the anonymized sections contain the same username as I'm using to log in)

When running etesync-dav I get the following output (I've replaced my username with MY_USERNAME in the log).

[2022-07-12 10:48:52 +0200] [1784/Thread-2] [INFO] PROPFIND request for '/' with depth '0' received from ::1 using 'macOS/12.4 (21F79) CalendarAgent/961.4.2'
[2022-07-12 10:48:52 +0200] [1784/Thread-2] [DEBUG] Request headers:
{'CONTENT_LENGTH': '127',
 'CONTENT_TYPE': 'text/xml',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': '*/*',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br',
 'HTTP_ACCEPT_LANGUAGE': 'en-GB,en;q=0.9',
 'HTTP_BRIEF': 't',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_DEPTH': '0',
 'HTTP_HOST': 'localhost:37358',
 'HTTP_PREFER': 'return=minimal',
 'HTTP_USER_AGENT': 'macOS/12.4 (21F79) CalendarAgent/961.4.2',
 'PATH_INFO': '/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '::1',
 'REMOTE_CERTIFICATE': None,
 'REMOTE_HOST': '',
 'REQUEST_METHOD': 'PROPFIND',
 'SCRIPT_NAME': '',
 'SERVER_NAME': '1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa',
 'SERVER_PORT': '37358',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'WSGIServer/0.2',
 'wsgi.errors': <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>,
 'wsgi.file_wrapper': <class 'wsgiref.util.FileWrapper'>,
 'wsgi.input': <_io.BufferedReader name=9>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}
[2022-07-12 10:48:52 +0200] [1784/Thread-2] [DEBUG] Sanitized script name: ''
[2022-07-12 10:48:52 +0200] [1784/Thread-2] [DEBUG] Sanitized path: '/'
[2022-07-12 10:48:52 +0200] [1784/Thread-2] [INFO] Access to '/' denied for anonymous user
[2022-07-12 10:48:52 +0200] [1784/Thread-2] [DEBUG] Asking client for authentication
[2022-07-12 10:48:52 +0200] [1784/Thread-2] [DEBUG] Response content:
Access to the requested resource forbidden.
[2022-07-12 10:48:52 +0200] [1784/Thread-2] [INFO] PROPFIND response status for '/' with depth '0' in 0.002 seconds: 401 Unauthorized
[2022-07-12 10:48:52 +0200] [1784/Thread-3] [INFO] PROPFIND request for '/' with depth '0' received from ::1 using 'macOS/12.4 (21F79) CalendarAgent/961.4.2'
[2022-07-12 10:48:52 +0200] [1784/Thread-3] [DEBUG] Request headers:
{'CONTENT_LENGTH': '127',
 'CONTENT_TYPE': 'text/xml',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': '*/*',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br',
 'HTTP_ACCEPT_LANGUAGE': 'en-GB,en;q=0.9',
 'HTTP_AUTHORIZATION': 'Basic **masked**',
 'HTTP_BRIEF': 't',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_DEPTH': '0',
 'HTTP_HOST': 'localhost:37358',
 'HTTP_PREFER': 'return=minimal',
 'HTTP_USER_AGENT': 'macOS/12.4 (21F79) CalendarAgent/961.4.2',
 'PATH_INFO': '/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '::1',
 'REMOTE_CERTIFICATE': None,
 'REMOTE_HOST': '',
 'REQUEST_METHOD': 'PROPFIND',
 'SCRIPT_NAME': '',
 'SERVER_NAME': '1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa',
 'SERVER_PORT': '37358',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'WSGIServer/0.2',
 'wsgi.errors': <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>,
 'wsgi.file_wrapper': <class 'wsgiref.util.FileWrapper'>,
 'wsgi.input': <_io.BufferedReader name=9>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}
[2022-07-12 10:48:52 +0200] [1784/Thread-3] [DEBUG] Sanitized script name: ''
[2022-07-12 10:48:52 +0200] [1784/Thread-3] [DEBUG] Sanitized path: '/'
[2022-07-12 10:48:52 +0200] [1784/Thread-3] [INFO] Successful login: 'MY_USERNAME'

Any advice on how to debug this would be appreciated!

jhass commented 1 year ago

For me the key on 13.4.1 was to include the port in the "Server Address" too, that is make it https://localhost:37358. Checking Wireshark it was ignoring the "Port" field and always tried ports 8843 and 443.