我想跳过 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)
....