Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Connor1996 committed Nov 27, 2017
1 parent f9f7091 commit 8447579
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions cmd/pd-tso-bench/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 7 additions & 7 deletions pd-client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand Down

0 comments on commit 8447579

Please sign in to comment.