From 844757965aea125b422aec746832c4681a36cf15 Mon Sep 17 00:00:00 2001 From: Connor1996 Date: Mon, 27 Nov 2017 14:54:58 +0800 Subject: [PATCH] fix ci --- cmd/pd-tso-bench/main.go | 6 +++--- pd-client/client.go | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/pd-tso-bench/main.go b/cmd/pd-tso-bench/main.go index 7952a00bdcad..ea59f823cc1d 100644 --- a/cmd/pd-tso-bench/main.go +++ b/cmd/pd-tso-bench/main.go @@ -43,9 +43,9 @@ func main() { flag.Parse() pdCli, err := pd.NewClient([]string{*pdAddrs}, pd.SecurityOption{ - TlsCAPath: *tlsCAPath, - TlsCertPath: *tlsCertPath, - TlsKeyPath: *tlsKeyPath, + TLSCAPath: *tlsCAPath, + TLSCertPath: *tlsCertPath, + TLSKeyPath: *tlsKeyPath, }) if err != nil { log.Fatal(err) diff --git a/pd-client/client.go b/pd-client/client.go index 0a1c48adac32..423bb1dfa246 100644 --- a/pd-client/client.go +++ b/pd-client/client.go @@ -104,9 +104,9 @@ type client struct { // SecurityOption records options about tls type SecurityOption struct { - TlsCAPath string - TlsCertPath string - TlsKeyPath string + TLSCAPath string + TLSCertPath string + TLSKeyPath string } // NewClient creates a PD client. @@ -229,12 +229,12 @@ func (c *client) getOrCreateGRPCConn(addr string) (*grpc.ClientConn, error) { } opt := grpc.WithInsecure() - if len(c.security.TlsCAPath) != 0 { + if len(c.security.TLSCAPath) != 0 { certificates := []tls.Certificate{} - if len(c.security.TlsCertPath) != 0 && len(c.security.TlsKeyPath) != 0 { + if len(c.security.TLSCertPath) != 0 && len(c.security.TLSKeyPath) != 0 { // Load the client certificates from disk - certificate, err := tls.LoadX509KeyPair(c.security.TlsCertPath, c.security.TlsKeyPath) + certificate, err := tls.LoadX509KeyPair(c.security.TLSCertPath, c.security.TLSKeyPath) if err != nil { return nil, errors.Errorf("could not load client key pair: %s", err) } @@ -243,7 +243,7 @@ func (c *client) getOrCreateGRPCConn(addr string) (*grpc.ClientConn, error) { // Create a certificate pool from the certificate authority certPool := x509.NewCertPool() - ca, err := ioutil.ReadFile(c.security.TlsCAPath) + ca, err := ioutil.ReadFile(c.security.TLSCAPath) if err != nil { return nil, errors.Errorf("could not read ca certificate: %s", err) }