我想跳过 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
}
Run Code Online (Sandbox Code Playgroud)
我检查了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": …Run Code Online (Sandbox Code Playgroud)