From a063c70c8458a33e62b7617e84783c250e51cdb3 Mon Sep 17 00:00:00 2001 From: Jan Simon Date: Tue, 25 Feb 2025 16:06:22 +0100 Subject: [PATCH] fix: lint issues --- influxdb3/client.go | 7 +++++-- influxdb3/query.go | 6 ++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/influxdb3/client.go b/influxdb3/client.go index fea3129..767672b 100644 --- a/influxdb3/client.go +++ b/influxdb3/client.go @@ -116,7 +116,7 @@ func New(config ClientConfig) (*Client, error) { } ok := certPool.AppendCertsFromPEM(certs) if !ok { - slog.Warn(fmt.Sprintf("No valid certificates found in %s", config.SSLRootsFilePath)) + slog.Warn("No valid certificates found in " + config.SSLRootsFilePath) } } } @@ -172,7 +172,10 @@ func setHTTPClientProxy(httpClient *http.Client, proxyURL *url.URL) { func setHTTPClientCertPool(httpClient *http.Client, certPool *x509.CertPool) { ensureTransportSet(httpClient) if transport, ok := httpClient.Transport.(*http.Transport); ok { - transport.TLSClientConfig = &tls.Config{RootCAs: certPool} + transport.TLSClientConfig = &tls.Config{ + RootCAs: certPool, + MinVersion: tls.VersionTLS12, + } } } diff --git a/influxdb3/query.go b/influxdb3/query.go index 0bca837..c90cac8 100644 --- a/influxdb3/query.go +++ b/influxdb3/query.go @@ -43,7 +43,6 @@ import ( ) func (c *Client) initializeQueryClient(hostPortURL string, certPool *x509.CertPool, proxyURL *url.URL) error { - var transport grpc.DialOption if certPool != nil { @@ -61,13 +60,12 @@ func (c *Client) initializeQueryClient(hostPortURL string, certPool *x509.CertPo // This approach is generally safer than implementing a custom Dialer because it leverages built-in // proxy handling, reducing the risk of introducing vulnerabilities or misconfigurations. // More info: https://github.com/grpc/grpc-go/blob/master/Documentation/proxy.md - prevHttpsProxy := os.Getenv("HTTPS_PROXY") - if prevHttpsProxy != "" && prevHttpsProxy != proxyURL.String() { + prevHTTPSProxy := os.Getenv("HTTPS_PROXY") + if prevHTTPSProxy != "" && prevHTTPSProxy != proxyURL.String() { slog.Warn( fmt.Sprintf("Environment variable HTTPS_PROXY is already set, "+ "it's value will be overridden with: %s", proxyURL.String()), ) - } err := os.Setenv("HTTPS_PROXY", proxyURL.String()) if err != nil {