code: func FromPeerConfig(peerCfg *fab.NetworkPeer) Option {
  	return func(p *Peer) error {
  
  		p.url = peerCfg.URL
  		p.serverName = getServerNameOverride(peerCfg)
  		p.inSecure = isInsecureConnectionAllowed(peerCfg)
  
  		var err error
  		p.certificate = peerCfg.TLSCACert
  		if peerCfg.GRPCOptions["allow-insecure"] == false {
  			//verify if certificate was expired or not yet valid
  			err = verifier.ValidateCertificateDates(p.certificate)
  			if err != nil {
  				logger.Warn(err)
  			}
  		}
  
  		// TODO: Remove upon making peer interface immutable
  		p.mspID = peerCfg.MSPID
  		p.kap = getKeepAliveOptions(peerCfg)
  		p.failFast = getFailFast(peerCfg)
  		return nil
  	}
  }
docs: // FromPeerConfig is a functional option for the peer.New constructor that configures a new peer
  // from a apiconfig.NetworkPeer struct