diff --git a/easy_config.go b/easy_config.go index 2d667a2..e279b13 100644 --- a/easy_config.go +++ b/easy_config.go @@ -4,6 +4,7 @@ import ( "crypto/tls" "crypto/x509" "errors" + "log" "time" etcd "github.com/coreos/etcd/clientv3" @@ -17,8 +18,11 @@ type EasyConfig struct { } func (c EasyConfig) prepare() (etcd.Config, error) { + log.Println("enter prepare() for EasyConfig") + log.Printf("clientCert is '%s'", c.ClientCert) cert, err := tls.X509KeyPair([]byte(c.ClientCert), []byte(c.ClientKey)) if err != nil { + log.Println("error building keypair") return etcd.Config{}, err } @@ -40,12 +44,14 @@ func (c EasyConfig) prepare() (etcd.Config, error) { conn, err := tls.Dial("tcp", c.Endpoints[0], tc) if err != nil { + log.Printf("can't connect to %s:%s", c.Endpoints[0], err) return etcd.Config{}, err } defer conn.Close() err = conn.Handshake() if err != nil { + log.Printf("failed tls handshake with %s:%s", c.Endpoints[0], err) return etcd.Config{}, err }