redpanda-data / redpanda-data/connect

Couchbase Options not supported

Open
#3,919 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ux
Dominant language
Go
Stars
8.8k
Forks
969
Avg merge
1d 13h
Merged PRs (30d)
64

Description

I would like to be able to connect to couchbase using a CA cert or be able to specify InsecureSkip (for local testing)

The needs to have SecurityConfig: gocb.SecurityConfig added. Below is some test code I made that uses the couchbase sdk to support these needs.

// Load CA certificate if available
	var tlsConfig *tls.Config
	if _, err := os.Stat(certPath); err == nil {
		caCert, err := os.ReadFile(certPath)
		if err != nil {
			log.Printf("Warning: Failed to read CA certificate: %v", err)
		} else {
			caCertPool := x509.NewCertPool()
			if caCertPool.AppendCertsFromPEM(caCert) {
				tlsConfig = &tls.Config{
					RootCAs: caCertPool,
				}
				fmt.Println("Loaded CA certificate")
			}
		}
	}

	// If no cert loaded, skip TLS verification
	if tlsConfig == nil {
		tlsConfig = &tls.Config{
			InsecureSkipVerify: true,
		}
		fmt.Println("Using InsecureSkipVerify for TLS")
	}

	// Connect to cluster
	cluster, err := gocb.Connect(connectionString, gocb.ClusterOptions{
		Authenticator: gocb.PasswordAuthenticator{
			Username: username,
			Password: password,
		},
		SecurityConfig: gocb.SecurityConfig{
			TLSRootCAs:    tlsConfig.RootCAs,
			TLSSkipVerify: tlsConfig.InsecureSkipVerify,
		},
	})

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Couchbase connection setup and compare its options with the gocb.ClusterOptions and SecurityConfig shown in the issue. Use the provided CA-certificate and InsecureSkipVerify scenarios to verify that both TLS configuration paths are supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.