Skip to content

SOGo: /.well-known/caldav and /.well-known/carddav redirect to http://, so iOS CalDAV/CardDAV setup fails #8297

Todo

Description

@danb35

Steps to reproduce

  • Install SOGo with DAV enabled, published through Traefik at https://sogo.example.com.
  • Send PROPFIND https://sogo.example.com/.well-known/caldav, for example by adding a CalDAV account on an iPhone (Settings → Apps → Calendar → Calendar Accounts → Add Account → Other → Add CalDAV Account), or with:
    curl -s -o /dev/null -X PROPFIND -H 'Depth: 0' -w '%{http_code} -> %{redirect_url}\n' https://sogo.example.com/.well-known/caldav
    

Expected behavior

301 to https://sogo.example.com/SOGo/dav/, and iOS finds the DAV principal there.

Actual behavior

/.well-known/caldav  301 -> http://sogo.example.com/SOGo/dav
/.well-known/carddav 301 -> http://sogo.example.com/SOGo/dav

The redirect drops to plain HTTP. iOS doesn't follow it and goes on to PROPFIND /, which ends at SOGo's web login page (200, not DAV), then tries /principals/ and /calendar/dav/<user>/ (both 405). Setup fails with "The operation could not be completed. (DAAccountValidationDomain error 100.)". Credentials are never sent. This also happens when the account comes from a configuration profile whose CalDAVPrincipalURL is https://sogo.example.com/SOGo/dav/: iOS still goes to the well-known path first.

Cause: imageroot/templates/SOGo.conf lines 114–115:

RewriteRule ^/.well-known/caldav/?$ /SOGo/dav [R=301]
RewriteRule ^/.well-known/carddav/?$ /SOGo/dav [R=301]

Apache receives plain HTTP from Traefik, so it makes the relative target an absolute http:// URL. The same template already hard-codes HTTPS for SOGo itself (x-webobjects-server-url "https://%{HTTP_HOST}e", server port 443), so an absolute HTTPS target matches it:

RewriteRule ^/.well-known/caldav/?$ https://%{HTTP_HOST}/SOGo/dav/ [R=301,L]
RewriteRule ^/.well-known/carddav/?$ https://%{HTTP_HOST}/SOGo/dav/ [R=301,L]

Tested on a production node: with this change applied to the generated state/config/SOGo.conf and Apache reloaded, the redirect goes to https://…/SOGo/dav/, the next PROPFIND /SOGo/dav/ returns 207, and both the CalDAV and the CardDAV account validate on the iPhone.

Components

SOGo 2.3.0 (ghcr.io/nethserver/sogo-server:5.12.12), on NS8 behind Traefik. Client: iPhone, iOS 26.

See also

Activity

  1. moved this from ToDo to In Progress in NethServeron Nov 26, 2026
  2. assigned and unassigned on Nov 30, 2026
  3. moved this from In Progress to Testing in NethServeron Nov 30, 2026
  4. added
    testing
    on Nov 30, 2026
  5. stephdl commented on Nov 30, 2026

    @stephdl

    QA
    test on ghcr.io/nethserver/sogo:2.3.2-dev.1

    verifiy the bug is not more reproducible

    @danb35 could you verify the bug ?

  6. danb35 commented on Nov 30, 2026

    @danb35
    Author

    Verified on ghcr.io/nethserver/sogo:2.3.2-dev.1 (updated from 2.3.1 on a Rocky 9 node behind Traefik). Before the update, PROPFIND /.well-known/caldav and /.well-known/carddav returned 301 -> http://<host>/SOGo/dav; after it, both return 301 -> https://<host>/SOGo/dav/, and the generated SOGo.conf has the new rules. On an iPhone (iOS 26), a configuration profile whose CalDAV/CardDAV accounts point at https://<host>/SOGo/dav/ now installs and both accounts validate; events and contacts sync in both directions with SOGo.

  7. added
    verified
    on Nov 30, 2026
  8. removed
    testing
    on Nov 30, 2026
  9. moved this from Testing to Verified in NethServeron Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

verified

Type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions