Skip to content

[feature/mtls-client-certificates] TLS client certificate (mTLS) support - #1606

Closed
bunducdragos wants to merge 1 commit into
owncloud:masterfrom
bunducdragos:feature/mtls-client-certificates
Closed

bunducdragos wants to merge 1 commit into
owncloud:masterfrom
bunducdragos:feature/mtls-client-certificates

Conversation

@bunducdragos

Copy link
Copy Markdown

Description

Adds TLS client certificate (mutual TLS) support to the app, building on the SDK changes in owncloud/ios-sdk#180.

  • Import / manage: a PKCS#12 (.p12/.pfx) file plus its password can be imported from two places:

    • the "Server URL" step when adding an account ("Use a client certificate…" below "Proceed")
    • the account editor (new "Client Certificate" section)

    The certificate's name and expiry are shown, and it can be replaced or removed. The shared UI lives in ClientCertificateManager (ownCloudAppShared).

  • Storage / networking: handled by the SDK's new OCClientIdentityStore and OCHTTPPipeline changes. Identities live in the shared keychain access group, so the File Provider, Share, Action and Intents extensions present the certificate too. A certificate is only presented to the host it was imported for.

  • OAuth2 / OIDC login: ASWebAuthenticationSession can't present client certificates provided by the app. When a certificate is stored for the authorization URL's host, the new MutualTLSBrowserSession (WKWebView-based, non-persistent data store, intercepts the callback scheme) is used instead. It is registered via OCAuthenticationMethodOAuth2.mutualTLSBrowserSessionClass.

  • Other HTTP stacks: ClientWebAppViewController (web office apps) answers client certificate challenges for the stored host. Media streaming (AVURLAsset) gets an AVAssetResourceLoaderDelegate that does the same.

  • Localization: new strings added to Localizable.xcstrings, with German translations.

  • ios-sdk: moves to the SDK PR's commit, which is based on the current ios-sdk master. That also picks up [fix/kw-bridge-interop] Fix KW bridge/IDP interoperability issues ios-sdk#174.

Related Issue

owncloud/ios-sdk#11
SDK PR: owncloud/ios-sdk#180

Motivation and Context

Self-hosted instances are often put behind a reverse proxy that requires a client certificate (ssl_verify_client on / SSLVerifyClient require). Until now the iOS app couldn't connect to them at all.

How Has This Been Tested?

  • On an iPhone 15 Pro, against an ownCloud server behind a reverse proxy that requires a client certificate:
    • importing the .p12 from the setup step
    • logging in with an app password
    • browsing and file access in the app and through the Files app (File Provider)
    • managing the certificate from the account editor after login
  • ownCloudAppTests on an iOS 26.3 simulator: 11/11 pass.
  • New SDK unit tests (ClientIdentityStoreTests, see SDK PR) pass.
  • SwiftLint shows no new warnings for the changed files.

Not tested: OIDC login through MutualTLSBrowserSession against a real IdP, background URLSession transfers while the app is suspended, and AVFoundation delivering client certificate challenges to the resource loader delegate.

Note: CI checks out ios-sdk from owncloud/ios-sdk, so the build will only find the new submodule commit once the SDK PR is merged. Until then, the commit is on bunducdragos/ios-sdk (branch feature/mtls-client-certificates).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • Added an issue with details about all relevant changes in the iOS documentation repository.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • Added changelog files for the fixed issues in folder changelog/unreleased

🤖 Generated with Claude Code

- Import a PKCS#12 (.p12/.pfx) file + password from the "Server URL" setup
  step and the account editor (new "Client Certificate" section); show
  the certificate's name and expiry, replace or remove it
  (ClientCertificateManager in ownCloudAppShared)
- MutualTLSBrowserSession: WKWebView-based OAuth2/OIDC browser session,
  used when a client certificate is stored for the authorization URL's
  host (ASWebAuthenticationSession can't present app-provided certificates)
- ClientWebAppViewController: answer client certificate challenges for
  web apps
- MediaDisplayViewController: answer client certificate challenges when
  streaming via AVAssetResourceLoaderDelegate
- Localizable.xcstrings: add new strings with German translations
- ios-sdk: switch to the mTLS branch, based on current ios-sdk master
  (adds OCClientIdentityStore and the pipeline/OAuth2 changes)

Fixes owncloud/ios-sdk#11

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bunducdragos
bunducdragos requested a review from a team as a code owner November 25, 2026 15:53
@CLAassistant

CLAassistant commented Nov 25, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@bunducdragos

Copy link
Copy Markdown
Author

Superseded by #1607 (this PR stopped syncing with its branch during today's GitHub outage and couldn't be reopened).

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants