Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-502

x.509 broken due to deprecated CertificateAuthenticator

    XMLWordPrintable

Details

    • CBG Sprint 30
    • 1

    Description

      Background

      GoCB deprecated CertificateAuthenticator in GOCBC-304 - which should've been backwards compatible. However, another commit causes a runtime error when the old struct is used.

      // CertificateAuthenticator is included for backwards compatibility only.
      // Deprecated: Use CertAuthenticator instead.
      type CertificateAuthenticator struct {
         CertAuthenticator
      }

      _, ok := auth.(CertAuthenticator)
      if !ok {
         return nil, ErrMixedCertAuthentication
      }

      Fix

      • We should update our cluster.Authenticate(gocb.CertificateAuthenticator{}) call to use the new struct instead to fix this.

      Testing

      • We should also try to get some sort of test coverage that would've caught this runtime error, even if we can't easily get a full end-to-end x.509 integration test.
        Perhaps an untrusted client cert would be sufficient enough to test that we can attempt to authenticate with the cluster.

      Attachments

        1. 192.168.0.145_node.zip
          3.42 MB
        2. certs.zip
          21 kB
        3. sgcollect_info_with_use_views.zip
          12.52 MB
        4. sgcollect_info.zip
          12.46 MB

        Issue Links

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

          Activity

            People

              ben.brooks Ben Brooks
              ben.brooks Ben Brooks
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty