Skip to content

Commit

Permalink
fix: lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jansimonb committed Feb 25, 2025
1 parent 311f69f commit a063c70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 5 additions & 2 deletions influxdb3/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Check warning on line 120 in influxdb3/client.go

View check run for this annotation

Codecov / codecov/patch

influxdb3/client.go#L113-L120

Added lines #L113 - L120 were not covered by tests
}
}
Expand Down Expand Up @@ -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,
}
}
}

Expand Down
6 changes: 2 additions & 4 deletions influxdb3/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit a063c70

Please sign in to comment.