code: func newDynamicTLSConfig(base *tls.Config, logger *log.Logger) *dynamicTLSConfig {
  	cfg := &dynamicTLSConfig{
  		base: base,
  	}
  	if len(base.Certificates) > 0 {
  		cfg.leaf = &base.Certificates[0]
  		// If this does error then future calls to Ready will fail
  		// It is better to handle not-Ready rather than failing
  		if err := parseLeafX509Cert(cfg.leaf); err != nil && logger != nil {
  			logger.Printf("[ERR] Error parsing configured leaf certificate: %v", err)
  		}
  	}
  	if base.RootCAs != nil {
  		cfg.roots = base.RootCAs
  	}
  	if !cfg.Ready() {
  		cfg.readyCh = make(chan struct{})
  	}
  	return cfg
  }
docs: // newDynamicTLSConfig returns a dynamicTLSConfig constructed from base.
  // base.Certificates[0] is used as the initial leaf and base.RootCAs is used as
  // the initial roots.