func (info TlsInlineCertKey) baseCertConfig() (*tls.Config, error) {
	_, err := newCert([]byte(info.Cert), []byte(info.Key))
	if err != nil {
		return nil, err
	}
	cfg := &tls.Config{
		MinVersion: tls.VersionTLS12,
	}
	cfg.GetCertificate = func(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error) {
		return newCert([]byte(info.Cert), []byte(info.Key))
	}
	cfg.GetClientCertificate = func(unused *tls.CertificateRequestInfo) (*tls.Certificate, error) {
		return newCert([]byte(info.Cert), []byte(info.Key))
	}
	return cfg, nil
}
baseCertConfig() populates tls struct with certificate data
package etcdv3
import (
	"crypto/tls"
	"crypto/x509"
	"encoding/pem"
	"fmt"
)
type TlsInlineCertKey struct {
	Cert   string
	Key    string
	CACert string
}
func (info TlsInlineCertKey) ClientConfigInlineCertKey() (*tls.Config, error) {
	var cfg *tls.Config
	var err error
	if info.Cert == "" || info.Key == "" {
		return nil, fmt.Errorf("Certificate and Key must both be present inline.")
	}
	if info.Cert != "" && info.Key != "" {
		cfg, err = info.baseCertConfig()
		if err != nil {
			return nil, err
		}
	}
	if info.CACert != "" {
		cfg.RootCAs, err = newCertPool(info.CACert)
		if err != nil {
			return nil, err
		}
	}
	return cfg, nil
}