Calendar (CalDAV)

The Calendar policy hands a CalDAV account to the native Calendar app of iOS and iPadOS via a configuration profile, which removes the need for manual setup by the end user. On current iOS versions, the calendar paths belonging to the account are discovered automatically according to RFC 6764 through a redirect at /.well-known/caldav. A correctly configured server-side /.well-known/caldav redirect is therefore mandatory on current iOS versions; specifying a principal URL alone is no longer sufficient there.


Configuration options

The following fields are available for the CalDAV account. They correspond to the keys of the Apple CalDAV payload (com.apple.caldav.account).

Account settings

  • Account description — display name of the account on the device.
  • Host — server address without scheme and without path (e.g. calendar.example.com).
  • Port — usually 443.
  • Use SSL — mandatory when the server is reachable via HTTPS. Without SSL enabled, an unencrypted connection is attempted on port 443, which fails.
  • User name — entered manually or via the placeholders ${user.name} or ${user.email}.
  • Password — if left empty, the device prompts for it during profile installation.
  • Principal URL (optional) — the path to the user principal (e.g. /remote.php/dav/principals/users/${user.name}/).

Automatic discovery via .well-known

Current iOS versions set up CalDAV accounts according to RFC 6764. The sequence is:

  1. A PROPFIND /.well-known/caldav request to the server configured under Host.
  2. The server responds with a redirect (301) to its DAV endpoint (/remote.php/dav for ownCloud/Nextcloud).
  3. The DAV endpoint is used to determine the current-user-principal and, from there, the user’s calendar area.

Reliable setup therefore depends entirely on a correct /.well-known redirect. On newer iOS versions, automatic discovery can no longer be bypassed by specifying a principal URL — without a working /.well-known redirect the setup fails, even if a principal URL is configured.


Server-side configuration of the redirect

/.well-known/caldav and /.well-known/carddav must redirect to the server’s DAV endpoint with a 301. The target address must begin with https:// and must not contain an internal port.

For nginx:

location = /.well-known/caldav  { return 301 https://$host/remote.php/dav; }
location = /.well-known/carddav { return 301 https://$host/remote.php/dav; }

For Apache (in the vHost):

Redirect 301 /.well-known/caldav  https://calendar.example.com/remote.php/dav
Redirect 301 /.well-known/carddav https://calendar.example.com/remote.php/dav

Verification

The redirect can be checked with curl:

curl -sI https://calendar.example.com/.well-known/caldav

The response must contain a redirect with a correct location header:

HTTP/2 301
location: https://calendar.example.com/remote.php/dav

The location header must begin with https:// and must not contain an internal port (e.g. :8080).


Troubleshooting

SymptomCauseSolution
Setup fails only on newer iOS versions; older devices keep workingThe redirect points to http:// (downgrade); older iOS versions tolerated thisCorrect the redirect to https://
301 points to an internal port (e.g. :8080)Reverse proxy/TLS termination, the web server does not know its public addressSet the redirect with the full https:// address on the proxy or web server
405 Method Not Allowed on paths such as / or /principals/Automatic discovery does not take effect and falls back to default paths that do not exist on the serverConfigure the /.well-known redirect correctly (mandatory on newer iOS versions)
The discovered path is obviously wrongPrincipal URL configured as a full URL instead of a plain path, or Use SSL not enabledEnter the principal URL as a plain path and enable Use SSL

Isolating the problem on the device

For isolation, a CalDAV account can be set up directly on the device as a test under SettingsCalendarAccounts. If the manually configured account connects while the account distributed via profile fails, the cause lies in automatic discovery (/.well-known) or in the principal URL distributed through the profile — not in the server itself.


Use on macOS

The CalDAV configuration and the server-side /.well-known requirement apply to macOS unchanged:

Top