iPhone calendar external access fails

I’m a new immigrant from OwnCloud. The transition was smooth and everything works perfectly except my phone calendar :frowning:

The problem

When using the iPhone Calendar app to access NextCloud on the same LAN as the NextCloud server, it works perfectly. When using the iPhone externally (same caldav settings) the calendar does not work.

Installation

Server OS: Fedora 25 up to date.
NextCloud: I installed it using the expression:

	dnf install nextcloud --enablerepo=updates-testing

	This gave me "Next 10.0.4 (stable)"

PHP: 7.0.15
Mariadb: 10.1.21
iPhone 7: iOS 10.2.1
SSL: A store-bought certificate. It checks out as A1 with Qualys SSL Labs
and it also passes tests using specialized iPhone apps. I use it successfully
for https, mail servers and clients.

Calendar clients that work (internally and externally)

Windows 10, Mozilla Thunderbird+Lightning calendar client.
Linux: Thunderbird+Lightning calendar client.
Android: Built-in calendar with Cadav Sync.

Also, the NextCloud iPhone app works, both internally and externally. The problem is only with the iPhone Calendar.

Details

Using the webapp on the server, I created a new calendar named “personal”. I added some events and tried some calendar clients running on other machines as listed above. I tested both internal LAN and external connections. Only the iPhone connected externally caused trouble.

To make this report, I deleted the caldav connection from the iPhone and created a new one. Here’s the server log when I do this while connected externally:

"PROPFIND /.well-known/caldav HTTP/1.1" 301 262
"PROPFIND /nextcloud/remote.php/caldav HTTP/1.1" 401 306
"PROPFIND /nextcloud/remote.php/caldav HTTP/1.1" 207 555
"OPTIONS /nextcloud/remote.php/caldav/principals/hugh/ HTTP/1.1" 200 -
(silence)

The connection setup window shows “happy checkmarks” and I can press “Save”. There is no new traffic when I press the Save button and the Calendar app shows no new calendar.

Next, I deleted the caldav account and recreated it again, this time with an internal WIFI connection:

"PROPFIND /.well-known/caldav HTTP/1.1" 301 262
"PROPFIND /nextcloud/remote.php/caldav HTTP/1.1" 401 306
"PROPFIND /nextcloud/remote.php/caldav HTTP/1.1" 207 555
"OPTIONS /nextcloud/remote.php/caldav/principals/hugh/ HTTP/1.1" 200 -

When I press the “Save” button:

"PROPFIND /nextcloud/remote.php/caldav/principals/hugh/ HTTP/1.1" 401 306
"PROPFIND /nextcloud/remote.php/caldav/principals/hugh/ HTTP/1.1" 207 1913
"OPTIONS /nextcloud/remote.php/caldav/principals/hugh/ HTTP/1.1" 200 -
"REPORT /nextcloud/remote.php/caldav/principals/ HTTP/1.1" 401 306
"REPORT /nextcloud/remote.php/caldav/principals/ HTTP/1.1" 200 521
"PROPFIND /nextcloud/remote.php/caldav/calendars/hugh/ HTTP/1.1" 401 306
"PROPFIND /nextcloud/remote.php/caldav/calendars/hugh/ HTTP/1.1" 207 7252
"PROPFIND /nextcloud/remote.php/caldav/principals/hugh/ HTTP/1.1" 207 717
"PROPFIND /nextcloud/remote.php/caldav/principals/hugh/ HTTP/1.1" 207 717
"PROPFIND /nextcloud/remote.php/caldav/calendars/hugh/personal/ HTTP/1.1" 207 500
"PROPFIND /nextcloud/remote.php/caldav/calendars/hugh/personal/ HTTP/1.1" 207 1568
"REPORT /nextcloud/remote.php/caldav/calendars/hugh/personal/ HTTP/1.1" 207 2701
"PROPFIND /nextcloud/remote.php/caldav/calendars/hugh/inbox/ HTTP/1.1" 207 379
"PROPFIND /nextcloud/remote.php/caldav/calendars/hugh/inbox/ HTTP/1.1" 207 379
"PROPFIND /nextcloud/remote.php/caldav/principals/hugh/ HTTP/1.1" 207 1913
"OPTIONS /nextcloud/remote.php/caldav/principals/hugh/ HTTP/1.1" 200 -
"REPORT /nextcloud/remote.php/caldav/principals/ HTTP/1.1" 200 521
"PROPFIND /nextcloud/remote.php/caldav/calendars/hugh/ HTTP/1.1" 207 7252
"PROPPATCH /nextcloud/remote.php/caldav/calendars/hugh/personal/ HTTP/1.1" 207 423
"PROPFIND /nextcloud/remote.php/caldav/calendars/hugh/inbox/ HTTP/1.1" 207 379
"PROPFIND /nextcloud/remote.php/caldav/calendars/hugh/inbox/ HTTP/1.1" 207 379

Everything now works in the iPhone Calendar app.

I tried another setup with a virtual host just for NextCloud and a self-signed certificate. Again, every other client worked both externally and internally. The iPhone only worked internally (after installing the certificate.)

I’d really like to get the phones working with external connections. Any ideas are appreciated.

SOLVED

How embarrassing!

iPhone -> Settings -> Cellular -> Use Cellular Data For -> Calendar & Reminders: ON

It was off by default. But it was ON for Contacts, which worked right out of the box with NextCloud. That should have been a clue but I didn’t see it.