Skip to content

Commit

Permalink
insecureSkipVerify can be passed as env variable and set to true; by …
Browse files Browse the repository at this point in the history
…default, it is set to false
  • Loading branch information
Bianco95 committed Jan 9, 2025
1 parent a943c71 commit ea0b30e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/interlink/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ func SetupTelemetry(ctx context.Context, serviceName string) (*sdktrace.TracerPr
return nil, fmt.Errorf("client certificate file path not provided. Since a CA certificate is provided, a client certificate is required for mutual TLS")
}

insecureSkipVerify := false
if os.Getenv("TELEMETRY_INSECURE_SKIP_VERIFY") == "true" {
insecureSkipVerify = true
}

certPool := x509.NewCertPool()
if !certPool.AppendCertsFromPEM(caCert) {
return nil, fmt.Errorf("failed to append CA certificate")
Expand All @@ -109,7 +114,7 @@ func SetupTelemetry(ctx context.Context, serviceName string) (*sdktrace.TracerPr
Certificates: []tls.Certificate{cert},
RootCAs: certPool,
MinVersion: tls.VersionTLS12,
InsecureSkipVerify: true, // #nosec
InsecureSkipVerify: insecureSkipVerify,

Check failure on line 117 in pkg/interlink/config.go

View workflow job for this annotation

GitHub Actions / lint

G402: TLS InsecureSkipVerify set true. (gosec)
}

creds := credentials.NewTLS(tlsConfig)
Expand Down

0 comments on commit ea0b30e

Please sign in to comment.