Download Latest Version gradle-wrapper.jar (51.0 kB)
Email in envelope

Get an email when there's a new version of HyperDroid-DAV

Home / cert4android
Name Modified Size InfoDownloads / Week
Parent folder
src 2018-06-25
gradle 2018-06-25
build.gradle 2018-06-25 1.4 kB
gradlew 2018-06-25 5.1 kB
LICENSE 2018-06-25 35.1 kB
gradle.properties 2018-06-25 29 Bytes
project.properties 2018-06-25 23 Bytes
README.md 2018-06-25 1.8 kB
run-tests.sh 2018-06-25 470 Bytes
Totals: 9 Items   44.0 kB 0

build status

cert4android

cert4android is an Android library for managing custom certificates which has been developed for DAVdroid. Feel free to use it in your own open-source app.

Generated KDoc: https://bitfireat.gitlab.io/cert4android/dokka/cert4android/

Discussion: https://forums.bitfire.at/category/7/transport-level-security

Features

  • uses a service to manage custom certificates
  • supports multiple threads and multiple processes (for instance, if you have an UI and a separate :sync process which should share the certificate information)

How to use

  1. Clone cert4android as a submodule.
  2. Add the submodule to settings.gradle / app/build.gradle.
  3. Create an instance of CustomCertManager (Context is required to connect to the CustomCertService, which manages the custom certificates).
  4. Use this instance as X509TrustManager in your calls (for instance, when setting up your HTTP client). Don't forget to get and use the hostnameVerifier(), too.
  5. Close the instance when it's not required anymore (will disconnect from the CustomCertService, thus allowing it to be destroyed).

You can overwrite resources when you want, just have a look at the res/strings directory. Especially certificate_notification_connection_security and trust_certificate_unknown_certificate_found should contain your app name.

License

Copyright (C) bitfire web engineering (Ricki Hirner, Bernhard Stockmann).

This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the conditions of the GNU GPL v3.

Source: README.md, updated 2018-06-25