code: func (conf Config) ToSecureOptions(newSelfSignedTLSCert genTLSCertFunc) (*comm.SecureOptions, error) {
  	if conf.PeerCACertPath == "" {
  		return &comm.SecureOptions{}, nil
  	}
  	caBytes, err := loadFile(conf.PeerCACertPath)
  	if err != nil {
  		return nil, errors.WithStack(err)
  	}
  	var keyBytes, certBytes []byte
  	// If TLS key and certificate aren't given, generate a self signed one on the fly
  	if conf.KeyPath == "" && conf.CertPath == "" {
  		tlsCert, err := newSelfSignedTLSCert()
  		if err != nil {
  			return nil, err
  		}
  		keyBytes, certBytes = tlsCert.Key, tlsCert.Cert
  	} else {
  		keyBytes, err = loadFile(conf.KeyPath)
  		if err != nil {
  			return nil, errors.WithStack(err)
  		}
  		certBytes, err = loadFile(conf.CertPath)
  		if err != nil {
  			return nil, errors.WithStack(err)
  		}
  	}
  	return &comm.SecureOptions{
  		Key:               keyBytes,
  		Certificate:       certBytes,
  		UseTLS:            true,
  		ServerRootCAs:     [][]byte{caBytes},
  		RequireClientCert: true,
  	}, nil
  }
docs: // ToSecureOptions converts this Config to SecureOptions.
  // The given function generates a self signed client TLS certificate if
  // the TLS certificate and key aren't present at the config