Open
Description
Hi,
I am having an issue on the master brach with connecting to caldav via ios. It's working well on thunderbird lightning, outlook via https://sourceforge.net/projects/outlookcaldavsynchronizer/ and android via davdroid. carddav is working fine on all of those. I am able to download the ics file from browser too. A very strange issue. I don't get any error in the logs.
Activity
ksmurchison commentedon Jan 31, 2019
Can you see the iOS device actually hitting Cyrus with ANY request?
stephenstubbs commentedon Feb 3, 2019
Yes I can see this.
HTTP/1.1 405 Method Not Allowed" (cnt-encoding=gzip; error=The requested method is not allowed for the URL.) [timing: cmd=0.000421 net=0.000027 total=0.000448]I am getting the same issue through contacts app on Mac OS.
stephenstubbs commentedon Feb 10, 2019
Is anybody else having this problem? I have tried reinstalling it but there is still the same issue.
ksmurchison commentedon Feb 10, 2019
What URLs is it trying to hit and with which methods? Do you have all of the prerequisites for Cyrus CalDAV and CardDAV installed? Have you enabled caldav and carddav in the http_modules option in imapd,conf? Have you enabled telemetry so we can see the entire HTTP request and response?
stephenstubbs commentedon Feb 14, 2019
I have reinstalled it again to be safe and now it is connecting but not syncing. I think this must be an issue with apple clients.
karagian commentedon Feb 19, 2019
Are you using calendars in the shared namespace maybe? If yes you may be hitting this bug:
#2373
Try applying the patch that dilyanpalauzov provided there. It really does wonders with DAV autodiscovery.
dilyanpalauzov commentedon Jan 15, 2021
Please clarify if this is still relevant, after upgrading the client and server software.
bamthomas commentedon Nov 1, 2022
Hello
I'm having the same issue, and I can't figure out how to solve it.
It is not related to shared account (I'm trying it with a "simple" personal account).
All is working fine with other clients than iOS or MacOS.
With those clients it seems they are not sending the
Authorizationheader with credentials. And at the same time it seems in the logsios_principals_url.txtin the message #2373 (comment) that the iPhone is actually authenticating.I saw that that there is a change since iOS 15 that the credentials are not sent without TLS w/ HTTP for security reason.
But when I try with the DAV client parameters (I saw this nextcloud issue):
dav.server.cowith user nameuser@otherdomain.cooruser@server.cooruserhttps://dav.server.cowith user nameuser@otherdomain.cooruser@server.cooruseruser@otherdomain.cooruser@server.cooruserIt ends wiith 405 on the url
/principalsWhich may be normal because it is not querying on
/dav/...url with aPROPFINDmethod.So I have 2 questions :
user@server.cowith serverdav.server.co?Thanks for your help.
dilyanpalauzov commentedon Nov 1, 2022
You can try the description at https://cal.aegee.org/h/en.html#apple : server aegee.org, username anonymous@aegee.org , any password. It works with iOS 14 and the only reason to provide a username is, that iOS insists on username. The server would return the same results without username (but different results with different username/password). I have not tried it with iOS 15. I could give you also valid username for read/write and you can try, if that works with iOS 15. My Cyrus system is however slightly patched (otherwise the anonymous login would not work).
bamthomas commentedon Nov 12, 2022
thank you very much @dilyanpalauzov for the test.
So yes it works with iOS with your server (but without auth ?).
Still not working with our :(
We have an nginx proxy (other services are doing http) that we configured so there is no PROPFIND on
/principalsurl :So now no more 405 but we have a 401. The phone is not authenticating and is not sending credentials in a basic auth
Authorizationheader. It drives me nut.So either we put the whole url and have a 401 :
or if we put the bare url :
Ending with 401 also, and we never see auth happening or
Authorizationheaders sent.Before we were using sabre server and it was working ok with iOS.
Maybe I will sniff how it was done there, and I'll put some more information here.
dilyanpalauzov commentedon Nov 12, 2022
You can authenticate with secret abc and username aaa in domain aegee.org towards that server. In case this works for you, this is good for me.
After the last 401 is received, the client (ios) is supposed to send the username and password. If fact the client is supposed always and unconditionally the send the username and password, if the user enters those, but in practice username/password are send when 401 in encountered. I have no iOS 15.
dilyanpalauzov commentedon Nov 12, 2022
Amendment: the server for authenticated iOS requests shall be set explicitly to webmail.aegee.org . It does return 401 more often than the server cal.aegee.org. cal.aegee.org always returns valid answers when no username/password is sent, 401 is returned only when username/password do not match. webmail.aegee.org returns 401 for any unauthenticated reques.
bamthomas commentedon Nov 12, 2022
yes it works : reject demand with a bad password, and works fine with the credentials you indicated (you can remove them if you wish). Thanks again for this test. At least I know that it can work \o/
Did you patch the code for cyrus-http?
If you didn't I guess it comes from my nginx configuration, or
imapd.confbamthomas commentedon Nov 12, 2022
With sabre I see that iOS is authenticating after the first 401that indicate nonce auth :
Then the next request is sending auth with nonce digest.
I also see
WWW-Authenticatesent by cyrus but iOS is not sending back the credentials.Do you have
allowplaintext: yesin yourimapd.conf?dilyanpalauzov commentedon Nov 12, 2022
Yes, many times in the past and I cannot say now what change I made for what reason… So I am not going to provide here patches which might or might not be relevant to your case.
You can run Cyrus IMAP/httpd locally on your computer, without nginx/http proxy and see if things work, when connecting with iOS. I have done so in the past. You can also adjust your proxy to forward the requests to webmail.aegee.org . If that works, then you have configured the proxy server correctly and the problem is with httpd. If this does not work, then your proxy server configuration is suboptimal.
I will appreciate if you share information how iOS 14→15 changed, provided that you know this.
#2634 (comment) contains
PROPFIND /principals/. This should have beenPROPFIND /dav/principals/and the prior requests shall have returned /dav/principal. In particular theDAV:current-user-principalrequest shall have returned that address. This is a hint on where to start investigatingdilyanpalauzov commentedon Nov 12, 2022
Yes I do have it, since the http reverse proxy does ensure the connection is TLS encrypted.
bamthomas commentedon Nov 13, 2022
So we may have roughly the same configuration. I was thinking that it may be cyrus that would detect clear password with non TLS ciphered connection that could be the root cause. But if you do it the same way (TLS termination on the proxy) then this hypothesis is wrong.
I tried proxying your site with our reverse proxy, and it works fine. Thanks again for the test (and the idea). As the backend is TLS encrypted I could not "debug" what was done right with your server that might be wrong with mine.
Actually it was not a migration from iOS 14→15 but a migration from sabre/Baikal→cyrus that showed regressions for iOS 15 users. But I will share as much information as I can to help ppl with the same issue (I can maybe find some iOS 14 devices around to see whether the behaviour is similar on the
PROPFINDdiscovery).So my next steps will be to activate logs for the proxy pointing to your server, to check the headers/url. And if I cannot understand, then make it run on a local machine.
bamthomas commentedon Nov 19, 2022
Hmm I think that I suspect HTTP/1.1 vs HTTP2 inconsistencies : when I return 401 or 301 with nginx proxy (listening in http2) then the negotiation is happening (it sends the Basic auth, and the backend is sending back a 207). But the mobile keeps not understanding the 207 answer. That means that each time the answer is coming from cyrus then iOS seems to not reading it. But when it comes from the proxy itself, it works fine.
For example if I do a curl like :
If I put
--http1.1instead of http2 then I have the answer.The communication between the mobile and proxy is in http2/TLS and the proxy is talking to cyrus in http 1.1.
Do you have a specific configuration with your proxy on that front?
Do you use a stream proxy?
dilyanpalauzov commentedon Nov 19, 2022
I use nginx reverse proxy and you have connected to that proxy (proxies). Between nginx and httpd there is no encryption and therefore no http/2. Nginx does TLS and http/2 for the external communication. I do not think that I use streams.
Do you mean that once you disable http/2 in httpd and connect directly to it without proxy from iOS there is no problem?
bamthomas commentedon Nov 19, 2022
Yay !! It works.
When the connection upgrade is hidden, iOS is adding the account.
Thank you very much @dilyanpalauzov for your support.
It was a proxy issue.
Cyrus is working fine with dav for iOS and MacOS.
So after refining the proxy configuration (no need actually for the
WWW-Authenticate: Negotiateheader) :No need also to translate
/to/dav(for the 405) as iOS was trying urls because it was failing with http2.Tested with iOS15 and iOS16, Mac OS X/10.14.6 (Mojave).
I guess this issue could be closed.