[Diagnostics] fix erigon support connection to diagnostics system (#7391)

This commit is contained in:
ledgerwatch 2023-04-26 15:57:39 +01:00 committed by GitHub
parent 01ce968361
commit d002861f5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,6 @@ import (
"bytes" "bytes"
"context" "context"
"crypto/tls" "crypto/tls"
"crypto/x509"
"encoding/binary" "encoding/binary"
"fmt" "fmt"
"io" "io"
@ -65,14 +64,9 @@ func connectDiagnostics(cliCtx *cli.Context) error {
diagnosticsUrl := cliCtx.String(diagnosticsURLFlag.Name) diagnosticsUrl := cliCtx.String(diagnosticsURLFlag.Name)
// Create a pool with the server certificate since it is not signed
// by a known CA
certPool := x509.NewCertPool()
// Create TLS configuration with the certificate of the server // Create TLS configuration with the certificate of the server
insecure := cliCtx.Bool(insecureFlag.Name) insecure := cliCtx.Bool(insecureFlag.Name)
tlsConfig := &tls.Config{ tlsConfig := &tls.Config{
RootCAs: certPool,
InsecureSkipVerify: insecure, //nolint:gosec InsecureSkipVerify: insecure, //nolint:gosec
} }