如何在flagsmith中跳过TLS验证?

问题描述 投票:0回答:1

我想跳过 flagsmith 的 TLS 验证。

注意:我使用的是flagsmithv3 go sdk。

这是我当前的代码:

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
}

我检查了

flagsmith
代码,所以我发现了这个,如何在&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)
    ....

go tls1.2 feature-flags flagsmith
1个回答
0
投票

目前还不可能,但这是一个很好的用例,我们将实现它。我为此创建了一个问题here

完全披露:我为 flagsmith 工作并编写了该 SDK

© www.soinside.com 2019 - 2024. All rights reserved.