kristapsdz / kcaldav

a simple, safe, and minimal CalDAV server

Home Page:https://kristaps.bsd.lv/kcaldav

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

415 Unsupported Media Type with davdroid

mk-f opened this issue · comments

commented

davdroid chokes on an '415 Unsupported Media Type', due to querying carddav- besides caldav-properties if I read this correctly. Would it be possible to just ignore all carddav-properties?

See #8

Here is the davdroid-log, kcaldav-system.log follows.

There is also an (davdroid) issue with authentication as noted here which may obscure the one described in this issue: when repeatedly trying to register an account in davdroid w/o closing the app in between, it seems to somehow get the nounce-counter wrong resulting in a 401.

See kristapsdz/kcgi#41

If I can test or help further in some way, let me know.

52386: <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><resourcetype /><displayname /><CARD:addressbook-description /><CARD:addressbook-home-set /><current-user-principal /></prop></propfind>
52386: 290 B rx
caldav.c:513: DEBUG: Known element: DAV::propfind
caldav.c:513: DEBUG: Known element: DAV::prop
caldav.c:489: DEBUG: Known property: DAV::resourcetype
caldav.c:489: DEBUG: Known property: DAV::displayname
caldav.c:487: DEBUG: Unknown property: urn:ietf:params:xml:ns:carddav:addressbook-description
caldav.c:487: DEBUG: Unknown property: urn:ietf:params:xml:ns:carddav:addressbook-home-set
caldav.c:489: DEBUG: Known property: DAV::current-user-principal
15282: Status: 401 Unauthorized\r
15282: WWW-Authenticate: Digest realm="kcaldav", algorithm="MD5-sess", qop="auth,auth-int", nonce="7667457262237677"\r
15282: Content-Encoding: gzip\r
15282: \r
15282: 163 B tx
20469: <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><resourcetype /><displayname /><CARD:addressbook-description /><CARD:addressbook-home-set /><current-user-principal /></prop></propfind>
20469: 290 B rx
caldav.c:513: DEBUG: Known element: DAV::propfind
caldav.c:513: DEBUG: Known element: DAV::prop
caldav.c:489: DEBUG: Known property: DAV::resourcetype
caldav.c:489: DEBUG: Known property: DAV::displayname
caldav.c:487: DEBUG: Unknown property: urn:ietf:params:xml:ns:carddav:addressbook-description
caldav.c:487: DEBUG: Unknown property: urn:ietf:params:xml:ns:carddav:addressbook-home-set
caldav.c:489: DEBUG: Known property: DAV::current-user-principal
kcaldav.c:415: DEBUG: test: PROPFIND: /<test>/<>/<>
kcaldav.c:462: DEBUG: test: principal validated
db.c:489: DEBUG: nonce count: 26
db.c:521: DEBUG: nonce attempt: 156397D23CD9498B
db.c:535: DEBUG: nonce created: 156397D23CD9498B
73767: Status: 401 Unauthorized\r
73767: WWW-Authenticate: Digest realm="kcaldav", algorithm="MD5-sess", qop="auth,auth-int", nonce="156397D23CD9498B", stale=true\r
73767: Content-Encoding: gzip\r
73767: \r
73767: 175 B tx
75416: <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><resourcetype /><displayname /><CARD:addressbook-description /><CARD:addressbook-home-set /><current-user-principal /></prop></propfind>
75416: 290 B rx
caldav.c:513: DEBUG: Known element: DAV::propfind
caldav.c:513: DEBUG: Known element: DAV::prop
caldav.c:489: DEBUG: Known property: DAV::resourcetype
caldav.c:489: DEBUG: Known property: DAV::displayname
caldav.c:487: DEBUG: Unknown property: urn:ietf:params:xml:ns:carddav:addressbook-description
caldav.c:487: DEBUG: Unknown property: urn:ietf:params:xml:ns:carddav:addressbook-home-set
caldav.c:489: DEBUG: Known property: DAV::current-user-principal
kcaldav.c:415: DEBUG: test: PROPFIND: /<test>/<>/<>
kcaldav.c:462: DEBUG: test: principal validated
db.c:456: DEBUG: nonce updated: 156397D23CD9498B, count 3
[2018-06-15 10:09]:propfind.c:63: WARNING: test@test.tld: not CalDAV MIME
85172: Status: 415 Unsupported Media Type\r
85172: Content-Encoding: gzip\r
85172: \r
85172: 62 B tx
48709: <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><resourcetype /><displayname /><n0:calendar-color xmlns:n0="http://apple.com/ns/ical/" /><CAL:calendar-description /><CAL:calendar-timezone /><current-user-privilege-set /><CAL:supported-calendar-component-set /><CAL:calendar-home-set /><current-user-principal /></prop></propfind>
48709: 435 B rx
caldav.c:513: DEBUG: Known element: DAV::propfind
caldav.c:513: DEBUG: Known element: DAV::prop
caldav.c:489: DEBUG: Known property: DAV::resourcetype
caldav.c:489: DEBUG: Known property: DAV::displayname
caldav.c:489: DEBUG: Known property: http://apple.com/ns/ical/:calendar-color
caldav.c:489: DEBUG: Known property: urn:ietf:params:xml:ns:caldav:calendar-description
caldav.c:489: DEBUG: Known property: urn:ietf:params:xml:ns:caldav:calendar-timezone
caldav.c:489: DEBUG: Known property: DAV::current-user-privilege-set
caldav.c:489: DEBUG: Known property: urn:ietf:params:xml:ns:caldav:supported-calendar-component-set
caldav.c:489: DEBUG: Known property: urn:ietf:params:xml:ns:caldav:calendar-home-set
caldav.c:489: DEBUG: Known property: DAV::current-user-principal
kcaldav.c:415: DEBUG: test: PROPFIND: /<test>/<>/<>
kcaldav.c:462: DEBUG: test: principal validated
db.c:456: DEBUG: nonce updated: 156397D23CD9498B, count 5
[2018-06-15 10:09]:propfind.c:63: WARNING: test@test.tld: not CalDAV MIME
91199: Status: 415 Unsupported Media Type\r
91199: Content-Encoding: gzip\r
91199: \r
91199: 62 B tx

I haven't tested the last commit (93115D8) on a live system yet, but I think that it (combined with the last kcgi commits) will fix this. I'll do some testing, but I don't have any davdroid clients.

commented

I just tested the last commits with davdroid: authentication and initial discovery is now working flawlessly - thank you very much!
I have still some issues with davdroid and kcaldav which I am trying to figure out, but will open a new issue if necessary.