code: func ReadConfig(reader io.Reader) (*FileConfig, error) {
  	// read & parse YAML config:
  	bytes, err := ioutil.ReadAll(reader)
  	if err != nil {
  		return nil, trace.Wrap(err, "failed reading Teleport configuration")
  	}
  	var fc FileConfig
  	if err = yaml.Unmarshal(bytes, &fc); err != nil {
  		return nil, trace.BadParameter("failed to parse Teleport configuration: %v", err)
  	}
  	// don't start Teleport with invalid ciphers, kex algorithms, or mac algorithms.
  	err = fc.Check()
  	if err != nil {
  		return nil, trace.BadParameter("failed to parse Teleport configuration: %v", err)
  	}
  	// now check for unknown (misspelled) config keys:
  	var validateKeys func(m YAMLMap) error
  	validateKeys = func(m YAMLMap) error {
  		var recursive, ok bool
  		var key string
  		for k, v := range m {
  			if key, ok = k.(string); ok {
  				if recursive, ok = validKeys[key]; !ok {
  					return trace.BadParameter("unrecognized configuration key: '%v'", key)
  				}
  				if recursive {
  					if m2, ok := v.(YAMLMap); ok {
  						if err := validateKeys(m2); err != nil {
  							return err
  						}
  					}
  				}
  			}
  		}
  		return nil
  	}
  	// validate configuration keys:
  	var tmp YAMLMap
  	if err = yaml.Unmarshal(bytes, &tmp); err != nil {
  		return nil, trace.BadParameter("error parsing YAML config")
  	}
  	if err = validateKeys(tmp); err != nil {
  		return nil, trace.Wrap(err)
  	}
  	return &fc, nil
  }
docs: // ReadConfig reads Teleport configuration from reader in YAML format