Skip to content

Commit

Permalink
address a few issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonah Back committed Dec 20, 2019
1 parent 0eaf54c commit b7d5be8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions cmd/agent/app/reporter/grpc/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (
)

const (
gRPCPrefix = "reporter.grpc."
collectorHostPort = gRPCPrefix + "host-port"
retry = gRPCPrefix + "retry.max"
gRPCPrefix = "reporter.grpc"
collectorHostPort = gRPCPrefix + ".host-port"
retry = gRPCPrefix + ".retry.max"
defaultMaxRetry = 3
discoveryMinPeers = gRPCPrefix + "discovery.min-peers"
discoveryMinPeers = gRPCPrefix + ".discovery.min-peers"
)

var tlsFlagsConfig = tlscfg.ClientFlagsConfig{
Expand Down
2 changes: 2 additions & 0 deletions pkg/config/tlscfg/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func (p Options) Config() (*tls.Config, error) {
tlsCfg := &tls.Config{
RootCAs: certPool,
ServerName: p.ServerName,
// #nosec G402
InsecureSkipVerify: p.SkipHostVerify,
}

if (p.CertPath == "" && p.KeyPath != "") || (p.CertPath != "" && p.KeyPath == "") {
Expand Down
7 changes: 5 additions & 2 deletions pkg/es/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package config

import (
"context"
"crypto/tls"
"io/ioutil"
"net/http"
"path/filepath"
Expand Down Expand Up @@ -291,8 +292,10 @@ func (c *Configuration) getConfigOptions(logger *zap.Logger) ([]elastic.ClientOp
}
} else {
httpTransport := &http.Transport{
Proxy: http.ProxyFromEnvironment,
}
Proxy: http.ProxyFromEnvironment,
// #nosec G402
TLSClientConfig: &tls.Config{InsecureSkipVerify: c.TLS.SkipHostVerify},
}
if c.TLS.CAPath != "" {
config, err := c.TLS.Config()
if err != nil {
Expand Down

0 comments on commit b7d5be8

Please sign in to comment.