nextcloud / nextcloud/ios

Invalid server certificate warning in iOS app with TLS client authentication

Open
#1,936 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
2.5k
Forks
1k
Avg merge
2d 18h
Merged PRs (30d)
13

Description

Steps to reproduce
  1. Deploy Nextcloud on a server, create an account
  2. Put nginx as reverse proxy in front of Nextcloud with ssl_verify_client optional in the config
  3. Create an app password, add account to the iOS app using the QR code
  4. Close the app and reopen it
Expected behaviour

The app reopens without certificate warning

Actual behaviour

A warning shows up: "The certificate for this server is invalid. Do you want to connect to the server anyway?"
The certificate displayed is the correct certificate.
Even if I click on Yes, the warning will reappear next time. I can access the files after clicking Yes.
If the ssl_verify_client optional line is removed in nginx, the warning does not appear next time the iOS app is restarted.

Note 1: the reverse proxy's TLS certificate is correctly configured, since Safari on iOS can connect to it properly.
Note 2: I have checked other tickets, this is not a duplicate, the only other mention is https://github.com/nextcloud/ios/issues/1682#issuecomment-1066117211

Screenshots

Same screenshot as reported in https://github.com/nextcloud/ios/issues/1682 (but likely for different reason)

Logs

No interesting log to show.

Reasoning or why should it be changed/implemented?

TLS client authentication can be used with Nextcloud using the SSO & SAML authentication extension, which works well with web browsers. AFAIK, the iOS app does not support this feature, so it can fallback to normal login/password authentication. However, it should gracefully ignore the Certificate Request from the server, just like an unconfigured web browser would, and not trigger a server certificate warning. The Android app does not have this problem.

Environment data

iOS version: iOS 14.8
Nextcloud iOS app version: Nextcloud Liquid iOS 4.3.1.0
Web server operating system: TrueNAS FreeBSD 12.2-RELEASE-p12 jail
Web server: nginx 1.20.2_9,2 on plain HTTP
Reverse proxy operating system: Docker version 20.10.12, build e91ed5707e with Debian GNU/Linux 10 Linux e86a668d8ff0 5.4.0-104-generic x86_64
Reverse proxy: openresty/1.19.9.1 built with OpenSSL 1.1.1n 15 Mar 2022
Database: mysql 8.0.28
PHP version: PHP 7.4.28 (fpm-fcgi)
Nextcloud version: 23.0.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by reproducing the reopening flow with nginx's ssl_verify_client optional setting and compare the iOS app's handling with that of Safari and the Android app; done means the valid server certificate is not warned about repeatedly while file access still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, nginx, swift
Domain
mobile, networking, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.