code: func (c *ClientConfig) CheckAndSetDefaults() error {
  	if len(c.Addrs) == 0 && c.DialContext == nil {
  		return trace.BadParameter("set parameter Addrs or DialContext")
  	}
  	if c.TLS == nil {
  		return trace.BadParameter("missing parameter TLS")
  	}
  	if c.KeepAlivePeriod == 0 {
  		c.KeepAlivePeriod = defaults.ServerKeepAliveTTL
  	}
  	if c.KeepAliveCount == 0 {
  		c.KeepAliveCount = defaults.KeepAliveCountMax
  	}
  	if c.DialContext == nil {
  		c.DialContext = NewAddrDialer(c.Addrs)
  	}
  	if c.TLS.ServerName == "" {
  		c.TLS.ServerName = teleport.APIDomain
  	}
  	// this logic is necessary to force client to always send certificate
  	// regardless of the server setting, otherwise client may pick
  	// not to send the client certificate by looking at certificate request
  	if len(c.TLS.Certificates) != 0 {
  		cert := c.TLS.Certificates[0]
  		c.TLS.Certificates = nil
  		c.TLS.GetClientCertificate = func(_ *tls.CertificateRequestInfo) (*tls.Certificate, error) {
  			return &cert, nil
  		}
  	}
  
  	return nil
  }
docs: // CheckAndSetDefaults checks and sets default config values