Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #603 - Add support for TLS client certificates #11314

Closed
wants to merge 7 commits into from

Commits on Jan 12, 2024

  1. Added support for TLS client certificates

    Using the new `AdvancedX509KeyManager` class from the `nextcloud-android-library` to add support for servers that require a TLS client certificate to connect.
    
    Signed-off-by: Elv1zz <[email protected]>
    Elv1zz committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    ebe3a7b View commit details
    Browse the repository at this point in the history
  2. Temporary change to make automated tests run

    Since the official nextcloud android-library does not have the new `AdvancedX509KeyManager`, the automated tests cannot build th
    e app. So for that I refer to my fork of the android-library for now. This commit shall be reverted before merge.
    
    Signed-off-by: Elv1zz <[email protected]>
    Elv1zz committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    f0ccd22 View commit details
    Browse the repository at this point in the history
  3. Handle TLS client certificates in NextCloudWebViewClient

    All interaction with the nextcloud server is handled by the `NextCloudWebViewClient`, so TLS client certificate handling should be done by that class. Since `AuthenticatorActivity` only extends `NextCloudWebViewClient` with some additional methods, it is enough to have the certificate handling in one place.
    
    Signed-off-by: Elv1zz <[email protected]>
    Elv1zz committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    a2e4b82 View commit details
    Browse the repository at this point in the history
  4. Using simplified way of removeKeys method

    Isntead of having to find the hostname and port from an URL (which might be more tricky than expected), we now can simply pass down the URL and `AdvancedX509KeyManager` will take care of finding the port from the URL.
    
    Signed-off-by: Elv1zz <[email protected]>
    Elv1zz committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    a17e536 View commit details
    Browse the repository at this point in the history
  5. Replacing magic number by well-known constant

    Improving code quality a bit by avoiding magic numbers.
    
    Signed-off-by: Elv1zz <[email protected]>
    Elv1zz committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    320c30f View commit details
    Browse the repository at this point in the history
  6. Reduce number of exit points

    The method `onReceivedHttpError` did have 3 exit points (`return`), but Codacy only allows us 2, so error handling for `request?.url` and `view?.context` was combined. Seems debatable, what's more readable, but the rules are the rules.
    
    Signed-off-by: Elv1zz <[email protected]>
    Elv1zz committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    01e99ea View commit details
    Browse the repository at this point in the history
  7. Using same gradle plugin as in nextcloud-library

    The `nextcloud-android-library` uses version `8.2.1` of the gradle plugin, so we have to use the same version for successful builds.
    
    Signed-off-by: Elv1zz <[email protected]>
    Elv1zz committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    5243195 View commit details
    Browse the repository at this point in the history