devi
devi

Reputation: 76

How to skip TLS verification in flagsmith?

I want to skip TLS verification for flagsmith.

Note: I'm using flagsmithv3 go sdk.

This is my current code:

func InitializeFlagsmith() *flagsmith.Client {
    apiKey := "ser..."
    customerAPIEndpoint := "https://example.com/api/v1/"

    // Create Flagsmith client options
    options := []flagsmith.Option{
        flagsmith.WithBaseURL(customerAPIEndpoint),
        flagsmith.WithLocalEvaluation(context.Background()),
        flagsmith.WithEnvironmentRefreshInterval(60 * time.Second),
    }

    // Initialize Flagsmith client with custom options
    flagsmithClient := flagsmith.NewClient(apiKey, options...)

    return flagsmithClient
}

I have checked flagsmith code so I found this, how can I change the client in the &Client?

// NewClient creates instance of Client with given configuration.
func NewClient(apiKey string, options ...Option) *Client {
    c := &Client{
        apiKey: apiKey,
        config: defaultConfig(),
        client: flaghttp.NewClient(),
    }

    c.client.SetHeaders(map[string]string{
        "Accept":            "application/json",
        "X-Environment-Key": c.apiKey,
    })
    c.client.SetTimeout(c.config.timeout)
    ....

Upvotes: 5

Views: 115

Answers (1)

gagan trivedi
gagan trivedi

Reputation: 434

It's not really possible right now, but it's good use case, and we will implement this. I have created an issue for this here

Full disclosure: I work for flagsmith and have written that SDK

Upvotes: 2

Related Questions