mam-dev / cosmo

Cosmo Calendar Server implements the server side of the CalDAV protocol.
Apache License 2.0
77 stars 45 forks source link

apple calendar (mojave) client connection issue #48

Open f1-outsourcing opened 3 years ago

f1-outsourcing commented 3 years ago

With the demo application, I have problems connecting the apple calendar (mojave vm). The same connect url just works fine in thunderbird.

Is this something that should be corrected on the proxy, or should the cosmo server support this client?

This is the tcpdump of the apple calender connection request.

10:06:06.955689 IP 192.168.122.152.49342 > 192.168.122.22.webcache: Flags [SEW], seq 2795606809, win 65535, options [mss 1460,nop,wscale 6,nop,nop,TS val 483205156 ecr 0,sackOK,eol], length 0
E..@..@.@.....z...z.................iA.............
.. $........
10:06:06.955800 IP 192.168.122.22.webcache > 192.168.122.152.49342: Flags [S.E], seq 2794007763, ack 2795606810, win 28960, options [mss 1460,sackOK,TS val 2646406745 ecr 483205156,nop,wscale 7], length 0
E..<..@.@.....z...z.......,......Rq v..........
...Y.. $....
10:06:06.956338 IP 192.168.122.152.49342 > 192.168.122.22.webcache: Flags [.], ack 1, win 2058, options [nop,nop,TS val 483205156 ecr 2646406745], length 0
E..4..@.@.....z...z...........,....
:C.....
.. $...Y
10:06:06.958138 IP 192.168.122.152.49342 > 192.168.122.22.webcache: Flags [P.], seq 1:330, ack 1, win 2058, options [nop,nop,TS val 483205158 ecr 2646406745], length 329: HTTP: PROPFIND /cosmo/dav/test%40example.com/calendar/ HTTP/1.1
E..}..@.@..y..z...z...........,....
.......
.. &...YPROPFIND /cosmo/dav/test%40example.com/calendar/ HTTP/1.1
Host: test2.local:8080
Content-Type: text/xml
Depth: 0
Brief: t
Accept: */*
Connection: keep-alive
Prefer: return=minimal
User-Agent: Mac+OS+X/10.14.6 (18G4032) CalendarAgent/416.5.1
Content-Length: 127
Accept-Language: en-us
Accept-Encoding: gzip, deflate

10:06:06.958211 IP 192.168.122.22.webcache > 192.168.122.152.49342: Flags [.], ack 330, win 235, options [nop,nop,TS val 2646406747 ecr 483205158], length 0
E..4..@.@..5..z...z.......,....c....v&.....
...[.. &
10:06:06.958286 IP 192.168.122.152.49342 > 192.168.122.22.webcache: Flags [P.], seq 330:457, ack 1, win 2058, options [nop,nop,TS val 483205158 ecr 2646406745], length 127: HTTP
E.....@.@..C..z...z........c..,....
.#.....
.. &...Y<?xml version="1.0" encoding="UTF-8"?>
<A:propfind xmlns:A="DAV:">
  <A:prop>
    <A:principal-URL/>
  </A:prop>
</A:propfind>

10:06:06.958310 IP 192.168.122.22.webcache > 192.168.122.152.49342: Flags [.], ack 457, win 235, options [nop,nop,TS val 2646406747 ecr 483205158], length 0
E..4..@.@..4..z...z.......,.........v&.....
...[.. &
10:06:06.959999 IP 192.168.122.22.webcache > 192.168.122.152.49342: Flags [P.], seq 1:161, ack 457, win 235, options [nop,nop,TS val 2646406749 ecr 483205158], length 160: HTTP: HTTP/1.1 401
E.....@.@.....z...z.......,.........v......
...].. &HTTP/1.1 401
WWW-Authenticate: Basic realm="Cosmo"
Content-Length: 0
Date: Wed, 07 Apr 2021 08:06:06 GMT
Keep-Alive: timeout=60
Connection: keep-alive

10:06:06.960462 IP 192.168.122.152.49342 > 192.168.122.22.webcache: Flags [.], ack 161, win 2056, options [nop,nop,TS val 483205159 ecr 2646406749], length 0
E..4..@.@.....z...z...........-t....7......
.. '...]
danielgrigore commented 3 years ago

Hi @f1-outsourcing,

Judging by the tcpdump and by the 401 response I can speculate that the credentials are not sent with original request. I don't see a 'Authorization:Basic ****' header in the request. That looks like a client issue. Cheers,

f1-outsourcing commented 3 years ago

I enabled the ssl frontend via haproxy and now it connected pffff. I guess it does not want to send plain text credentials, however it does not report that at all.

f1-outsourcing commented 3 years ago

Hi @danielgrigore

Just to summarize, after getting a cert for the caldav.

When I do not have the redirection of /.well-known/caldav to /cosmo/dav/users/ I am getting the error "unable to verify account name or password". The proxy logs these urls

 404 571 - - ---- 10/1/0/0/0 0/0 "PROPFIND /.well-known/caldav HTTP/1.1"
 302 111 - - LR-- 10/1/0/0/0 0/0 "PROPFIND / HTTP/1.1"
 401 120 - - ---- 10/1/0/0/0 0/0 "PROPFIND /cosmo/dav HTTP/1.1"
 500 272 - - ---- 10/1/0/0/0 0/0 "PROPFIND /cosmo/dav HTTP/1.1"
 404 571 - - ---- 10/1/0/0/0 0/0 "PROPFIND /caldav/v2 HTTP/1.1"
 404 571 - - ---- 10/1/0/0/0 0/0 "PROPFIND /principals/users/test/ HTTP/1.1"
 404 571 - - ---- 10/1/0/0/0 0/0 "PROPFIND /principals/ HTTP/1.1"
 404 571 - - ---- 10/1/0/0/0 0/0 "PROPFIND /dav/principals/ HTTP/1.1"
 404 571 - - ---- 10/1/0/0/0 0/0 "PROPFIND /.well-known/caldav HTTP/1.1"
 302 111 - - LR-- 10/1/0/0/0 0/0 "PROPFIND / HTTP/1.1"
 401 120 - - ---- 10/1/0/0/0 0/0 "PROPFIND /cosmo/dav HTTP/1.1"
 404 261 - - ---- 10/1/0/0/0 0/0 "PROPFIND /cosmo/dav HTTP/1.1"
 571 - - ---- 10/1/0/0/0 0/0 "PROPFIND /caldav/v2 HTTP/1.1"
 404 571 - - ---- 10/1/0/0/0 0/0 "PROPFIND /principals/users/test%40xxxxxxx.xxx/ HTTP/1.1"
 404 571 - - ---- 10/1/0/0/0 0/0 "PROPFIND /principals/ HTTP/1.1"
 404 571 - - ---- 10/1/0/0/0 0/0 "PROPFIND /dav/principals/ HTTP/1.1"

When I enable the redirection /.well-known/caldav to /cosmo/dav/users/

 302 118 - - LR-- 9/1/0/0/0 0/0 "PROPFIND /.well-known/caldav HTTP/1.1"
 401 120 - - ---- 9/1/0/0/0 0/0 "PROPFIND /cosmo/dav/users/ HTTP/1.1"
 500 279 - - ---- 9/1/0/0/0 0/0 "PROPFIND /cosmo/dav/users/ HTTP/1.1"
 302 111 - - LR-- 9/1/0/0/0 0/0 "PROPFIND / HTTP/1.1"
 401 120 - - ---- 9/1/0/0/0 0/0 "PROPFIND /cosmo/dav HTTP/1.1"
 500 272 - - ---- 9/1/0/0/0 0/0 "PROPFIND /cosmo/dav HTTP/1.1"
 404 571 - - ---- 9/1/0/0/0 0/0 "PROPFIND /caldav/v2 HTTP/1.1"
 404 571 - - ---- 9/1/0/0/0 0/0 "PROPFIND /principals/users/test/ HTTP/1.1"
 404 571 - - ---- 9/1/0/0/0 0/0 "PROPFIND /principals/ HTTP/1.1"
 404 571 - - ---- 9/1/0/0/0 0/0 "PROPFIND /dav/principals/ HTTP/1.1"
 302 118 - - LR-- 9/1/0/0/0 0/0 "PROPFIND /.well-known/caldav HTTP/1.1"
 401 120 - - ---- 9/1/0/0/0 0/0 "PROPFIND /cosmo/dav/users/ HTTP/1.1"
 207 610 - - ---- 9/1/0/0/0 0/0 "PROPFIND /cosmo/dav/users/ HTTP/1.1"
 200 219 - - ---- 9/1/0/0/0 0/0 "OPTIONS /cosmo/dav/users/test%40xxxxxx.xxx/ HTTP/1.1"
 401 120 - - ---- 11/2/0/0/0 0/0 "PROPFIND /cosmo/dav/users/test%40xxxxxx.xxx/ HTTP/1.1"
 404 261 - - ---- 11/2/0/0/0 0/0 "PROPFIND /cosmo/dav/users/test%40xxxxxx.xxx/ HTTP/1.1"
 404 261 - - ---- 11/2/0/0/0 0/0 "PROPFIND /cosmo/dav/users/test%40xxxxxx.xxx/ HTTP/1.1"
 302 111 - - LR-- 11/2/0/0/0 0/0 "PROPFIND / HTTP/1.1"
 401 120 - - ---- 13/3/0/0/0 0/0 "PROPFIND /cosmo/dav HTTP/1.1"
 404 261 - - ---- 13/3/0/0/0 0/0 "PROPFIND /cosmo/dav HTTP/1.1"
 404 571 - - ---- 13/3/0/0/0 0/0 "PROPFIND /principals/ HTTP/1.1"
 404 261 - - ---- 13/3/0/0/0 0/0 "PROPFIND /cosmo/dav/users/test%40xxxxxx.xxx HTTP/1.1"

Apple creates the caldav account and shows it in the accounts section. However when I open the calendar application, and click the just created calendar. I am getting this error "the url https://cal.xxxxxx.xxx/dav/users/test@example.com encountered HTTP error 404. Make sure the url is correct."

Are you interested in resolving this or is this beyond the scope of cosmo?

danielgrigore commented 3 years ago

Hi @f1-outsourcing

I'm not sure I understood the issue correctly, but using cosmo with the default authentication provider does not create any default calendars, but only creates the user account.

To create a calendar collection you need to perform a MKCALENDAR request like below curl -i -X"MKCALENDAR" -u"test_account@XXX.xx:*********" -H'Content-Type: application/xml;charset="UTF-8"' "http://localhost:8080/cosmo/dav/test_account@XXX.xx/MyNewCalendar"

Then to add an event to your collection you execute a PUT request: curl -i -X"PUT" -u"test_account@XXX.xx:*********" -H'Content-Type: text/calendar' -H"If-none-match:*" --data-binary @recurrent-event1.ics "http://localhost:8080/cosmo/dav/test_account@XXX.xx:*********/MyNewCalendar/rec1.ics"

Cheers,

f1-outsourcing commented 3 years ago

Yes I did created the calendar like that, also tried just now to create a calendar named home. But apple calendar gui keeps complaining about "No calendar home was specified for the account test" after doing 3x request to "PROPFIND /cosmo/dav/test@xxxxxx.xxx/calendar/ HTTP/1.1"

curl -X"MKCALENDAR" -H"Content-Type:application/xml" -utest@xxxxxx.xxx:test321 http://192.168.143.22:8080/cosmo/dav/test@xxxxxx.xxx/calendar
curl -X"MKCALENDAR" -H"Content-Type:application/xml" -utest@xxxxxx.xxx:test321 http://192.168.143.22:8080/cosmo/dav/test@xxxxxx.xxx/home
f1-outsourcing commented 3 years ago

Maybe it is something like this is missing? https://icalendar.org/CalDAV-Access-RFC-4791/6-2-1-caldav-calendar-home-set-property.html

f1-outsourcing commented 3 years ago

This[1] is a similar issue with sabre-dav

I tried this url 'https://xxxxxx/cosmo/dav/principals/test@xxxxx.xxx' but gives auth error

https://github.com/sabre-io/dav/issues/983#issuecomment-316672128

f1-outsourcing commented 3 years ago

Ok, let me ask differently, did you ever get it to work with macos? Is there some info available on what devices this has been tested?

danielgrigore commented 3 years ago

Hi @f1-outsourcing

As far as we tested it our CalDAV server which is backed by Cosmo works fine with Apple clients. You can try it yourself by creating a free account at gmx.com or mail.com Maybe this way you will figure it out what the problem is.

Cheers,

f1-outsourcing commented 3 years ago

Ok I will try this weekend (pffff, for the sixth time I am getting "A technical error has occurred. Error Code: b9688393-7898-47e0-8354-8a2b2c8e8a85", Even decided to disable ublock)

Looks more like fake websites or so again thechnical errors 202123-13M31-httpssignup gmx com 1559516-header-signup1-1

Do you maybe have a test account I can use? Or you know some other domains that use this?

f1-outsourcing commented 3 years ago

Are you messing with me? These sites do not seem to work. untitled

f1-outsourcing commented 3 years ago

Do you have some other environment to test on?