Managing TLS Identities — Working with Peer-to-Peer Syncs

    Description — Couchbase Lite’s Peer-to-Peer Synchronization enables edge devices to synchronize securely without consuming centralized cloud-server resources
    Abstract — This content covers how to manage TLS identities using Couchbase Lite peer-to-peer sync
    Related Content — API Reference | Passive Peer | Active Peer

    Description — Couchbase Lite’s Peer-to-Peer Synchronization enables edge devices to synchronize securely without consuming centralized cloud-server resources
    Abstract — This content covers how to manage TLS identities using Couchbase Lite peer-to-peer sync
    Related Content — API Reference | Passive Peer | Active Peer

    Overview

    • This describes the configuration and management of TLS identities

    API References

    You can find Android API References here.

    Creating TLS Identity

    There are couple of options by which TLS Identity is created:

    Use Anonymous Cert

    Anonymous certification uses the self signed certificate auto-generated by Couchbase Lite when TLS is enabled, but no TLSIdentity is provided.

    listenerConfig.disableTLS  = false // Use with anonymous self signed cert
    listenerConfig.tlsIdentity = nil

    Import a Cert

    Use the TLSIdentity class’s importIdentity() method to import a certificate that can be bundled with the app and-or added to the keychain.

    1. First check the keychain to see if the identity already exists

    2. Check for an existing resource bundle

    3. Import from an existing resource bundle

    4. Store imported identity in keychain

    5. Use keychain identity in config

    Delete TLS Identity

    String thisAlias = "alias-to-delete";
    final KeyStore thisKeyStore
      =  KeyStore.getInstance("AndroidKeyStore");
    thisKeyStore.load(null);
    thisKeyStore.deleteEntry(thisAlias);
    Enterprise Edition only
    This an Enterprise Edition feature. Purchase the Enterprise License, which includes official Couchbase Support, to use it in production (see the license and support https://www.couchbase.com/licensing-and-support-faq).