Uploaded image for project: 'Couchbase Documentation'
  1. Couchbase Documentation
  2. DOC-10840

Python 3.x and 4.x CertificateAuthenticator examples are incorrect

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • None
    • sdk
    • 0

    Description

      The examples shows creating a CertAuthenticator/CertificateAuthenticator from a dict, but no unpacking the dict when creating the authenticator. Need to make the small update to indicate the dict should be unpacked.

      3.x sample snippet

      from couchbase.cluster import Cluster, ClusterOptions
      from couchbase_core.cluster import CertAuthenticator
      import os.path
       
      # point to certificates, keys, and trust stores;
      # for the purposes of this code,
      # the script in etc/x509-cert will generate these
      clientdir = "etc/x509-cert/SSLCA/clientdir"
      options = dict(cert_path=os.path.join(clientdir, "client.pem"),
          trust_store_path=os.path.join(clientdir, "trust.pem"),
          key_path=os.path.join(clientdir, "client.key"))
       
      cluster = Cluster('couchbase://localhost', ClusterOptions(
          CertAuthenticator(options)
          )
      )
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jared.casey Jared Casey
            jared.casey Jared Casey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty