code: func NewStreamConnection(ctx fabcontext.Client, chConfig fab.ChannelCfg, streamProvider StreamProvider, url string, opts ...options.Opt) (*StreamConnection, error) {
  	conn, err := NewConnection(ctx, url, opts...)
  	if err != nil {
  		return nil, err
  	}
  
  	stream, err := streamProvider(conn.conn)
  	if err != nil {
  		conn.commManager.ReleaseConn(conn.conn)
  		return nil, errors.Wrapf(err, "could not create stream to %s", url)
  	}
  
  	if stream == nil {
  		return nil, errors.New("unexpected nil stream received from provider")
  	}
  
  	peer, ok := peer.FromContext(stream.Context())
  	if !ok || peer == nil {
  		//return error - certificate is not available
  		return nil, errors.Wrap(err, "No peer cert in GRPC stream")
  
  	}
  
  	if peer.AuthInfo != nil {
  		tlsInfo := peer.AuthInfo.(credentials.TLSInfo)
  		for _, peercert := range tlsInfo.State.PeerCertificates {
  			err := verifier.ValidateCertificateDates(peercert)
  			if err != nil {
  				logger.Error(err)
  				return nil, errors.Wrapf(err, "error validating certificate dates for [%v]", peercert.Subject)
  			}
  		}
  	}
  
  	return &StreamConnection{
  		GRPCConnection: conn,
  		chConfig:       chConfig,
  		stream:         stream,
  	}, nil
  }
docs: // NewStreamConnection creates a new connection with stream