From 271b0ac95ee4426f3495a2577b624296c5372a70 Mon Sep 17 00:00:00 2001 From: vahid-sohrabloo Date: Fri, 17 Jul 2020 20:31:10 +0430 Subject: [PATCH] AppendCertsFromPEM doesn't have error and removes pgTLSArgs AppendCertsFromPEM doesn't have error and removes pgTLSArgs because not used --- config.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/config.go b/config.go index 44953e0f..906ed7f4 100644 --- a/config.go +++ b/config.go @@ -571,13 +571,6 @@ func parseServiceSettings(servicefilePath, serviceName string) (map[string]strin return settings, nil } -type pgTLSArgs struct { - sslMode string - sslRootCert string - sslCert string - sslKey string -} - // configTLS uses libpq's TLS parameters to construct []*tls.Config. It is // necessary to allow returning multiple TLS configs as sslmode "allow" and // "prefer" allow fallback. @@ -662,7 +655,7 @@ func configTLS(settings map[string]string) ([]*tls.Config, error) { } if !caCertPool.AppendCertsFromPEM(caCert) { - return nil, errors.Errorf("unable to add CA to cert pool: %w", err) + return nil, errors.New("unable to add CA to cert pool") } tlsConfig.RootCAs = caCertPool