diff --git a/tools/nfd-status-http-server-files/nfd-status.xsl b/tools/nfd-status-http-server-files/nfd-status.xsl
index 92a0488..843e4f2 100644
--- a/tools/nfd-status-http-server-files/nfd-status.xsl
+++ b/tools/nfd-status-http-server-files/nfd-status.xsl
@@ -22,7 +22,7 @@
     <xsl:variable name="version">
       <xsl:apply-templates select="nfd:nfdStatus/nfd:generalStatus/nfd:version"/>
     </xsl:variable>
-    <span class="grey">Powered by </span><a target="_blank" href="http://named-data.net/doc/NFD/"><span class="green">NFD version <xsl:value-of select="$version"/></span></a><span class="grey">.</span>
+    <span class="grey">Powered by </span><a target="_blank" href="https://named-data.net/doc/NFD/"><span class="green">NFD version <xsl:value-of select="$version"/></span></a><span class="grey">.</span>
   </footer>
   </body>
   </html>
@@ -73,7 +73,6 @@
   <table class="item-list">
     <thead>
       <tr>
-        <th>NFD ID</th>
         <th>Version</th>
         <th>Start time</th>
         <th>Current time</th>
@@ -93,7 +92,6 @@
     </thead>
     <tbody>
       <tr class="center">
-        <td><xsl:apply-templates select="nfd:nfdId"/></td>
         <td><xsl:value-of select="nfd:version"/></td>
         <td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:startTime" /></xsl:call-template></td>
         <td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:currentTime" /></xsl:call-template></td>
diff --git a/tools/nfdc/forwarder-general-module.cpp b/tools/nfdc/forwarder-general-module.cpp
index ee3e0af..e490892 100644
--- a/tools/nfdc/forwarder-general-module.cpp
+++ b/tools/nfdc/forwarder-general-module.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
@@ -30,11 +30,6 @@
 namespace tools {
 namespace nfdc {
 
-ForwarderGeneralModule::ForwarderGeneralModule()
-  : m_nfdIdCollector(nullptr)
-{
-}
-
 void
 ForwarderGeneralModule::fetchStatus(Controller& controller,
                                     const function<void()>& onSuccess,
@@ -55,30 +50,17 @@
   return status.getCurrentTimestamp() - status.getStartTimestamp();
 }
 
-const Name&
-ForwarderGeneralModule::getNfdId() const
-{
-  if (m_nfdIdCollector != nullptr && m_nfdIdCollector->hasNfdId()) {
-    return m_nfdIdCollector->getNfdId();
-  }
-
-  static Name unavailable("/nfdId-unavailable");
-  return unavailable;
-}
-
 void
 ForwarderGeneralModule::formatStatusXml(std::ostream& os) const
 {
-  this->formatItemXml(os, m_status, this->getNfdId());
+  this->formatItemXml(os, m_status);
 }
 
 void
-ForwarderGeneralModule::formatItemXml(std::ostream& os, const ForwarderStatus& item,
-                                      const Name& nfdId) const
+ForwarderGeneralModule::formatItemXml(std::ostream& os, const ForwarderStatus& item) const
 {
   os << "<generalStatus>";
 
-  os << "<nfdId>" << nfdId << "</nfdId>";
   os << "<version>" << xml::Text{item.getNfdVersion()} << "</version>";
   os << "<startTime>" << xml::formatTimestamp(item.getStartTimestamp()) << "</startTime>";
   os << "<currentTime>" << xml::formatTimestamp(item.getCurrentTimestamp()) << "</currentTime>";
@@ -110,14 +92,12 @@
 ForwarderGeneralModule::formatStatusText(std::ostream& os) const
 {
   os << "General NFD status:\n";
-  this->formatItemText(os, m_status, this->getNfdId());
+  this->formatItemText(os, m_status);
 }
 
 void
-ForwarderGeneralModule::formatItemText(std::ostream& os, const ForwarderStatus& item,
-                                       const Name& nfdId) const
+ForwarderGeneralModule::formatItemText(std::ostream& os, const ForwarderStatus& item) const
 {
-  os << "                 nfdId=" << nfdId << "\n";
   os << "               version=" << item.getNfdVersion() << "\n";
   os << "             startTime=" << text::formatTimestamp(item.getStartTimestamp()) << "\n";
   os << "           currentTime=" << text::formatTimestamp(item.getCurrentTimestamp()) << "\n";
@@ -137,54 +117,6 @@
   os << "             nOutNacks=" << item.getNOutNacks() << "\n";
 }
 
-NfdIdCollector::NfdIdCollector(unique_ptr<ndn::Validator> inner)
-  : m_inner(std::move(inner))
-  , m_hasNfdId(false)
-{
-  BOOST_ASSERT(m_inner != nullptr);
-}
-
-const Name&
-NfdIdCollector::getNfdId() const
-{
-  if (!m_hasNfdId) {
-    BOOST_THROW_EXCEPTION(std::runtime_error("NfdId is unavailable"));
-  }
-
-  return m_nfdId;
-}
-
-void
-NfdIdCollector::checkPolicy(const Data& data, int nSteps,
-                            const ndn::OnDataValidated& accept,
-                            const ndn::OnDataValidationFailed& reject,
-                            std::vector<shared_ptr<ndn::ValidationRequest>>& nextSteps)
-{
-  ndn::OnDataValidated accepted = [this, accept] (const shared_ptr<const Data>& data) {
-    accept(data); // pass the Data to Validator user's validated callback
-
-    if (m_hasNfdId) {
-      return;
-    }
-
-    const ndn::Signature& sig = data->getSignature();
-    if (!sig.hasKeyLocator()) {
-      return;
-    }
-
-    const ndn::KeyLocator& kl = sig.getKeyLocator();
-    if (kl.getType() != ndn::KeyLocator::KeyLocator_Name) {
-      return;
-    }
-
-    m_nfdId = kl.getName();
-    m_hasNfdId = true;
-  };
-
-  BOOST_ASSERT(nSteps == 0);
-  m_inner->validate(data, accepted, reject);
-}
-
 } // namespace nfdc
 } // namespace tools
 } // namespace nfd
diff --git a/tools/nfdc/forwarder-general-module.hpp b/tools/nfdc/forwarder-general-module.hpp
index 9fc6a68..4d65c83 100644
--- a/tools/nfdc/forwarder-general-module.hpp
+++ b/tools/nfdc/forwarder-general-module.hpp
@@ -27,7 +27,6 @@
 #define NFD_TOOLS_NFDC_FORWARDER_GENERAL_MODULE_HPP
 
 #include "module.hpp"
-#include <ndn-cxx/security/validator.hpp>
 
 namespace nfd {
 namespace tools {
@@ -35,16 +34,12 @@
 
 using ndn::nfd::ForwarderStatus;
 
-class NfdIdCollector;
-
 /** \brief provides access to NFD forwarder general status
  *  \sa https://redmine.named-data.net/projects/nfd/wiki/ForwarderStatus
  */
 class ForwarderGeneralModule : public Module, noncopyable
 {
 public:
-  ForwarderGeneralModule();
-
   void
   fetchStatus(Controller& controller,
               const function<void()>& onSuccess,
@@ -52,21 +47,14 @@
               const CommandOptions& options) override;
 
   void
-  setNfdIdCollector(const NfdIdCollector& nfdIdCollector)
-  {
-    m_nfdIdCollector = &nfdIdCollector;
-  }
-
-  void
   formatStatusXml(std::ostream& os) const override;
 
   /** \brief format a single status item as XML
    *  \param os output stream
    *  \param item status item
-   *  \param nfdId NFD's signing certificate name
    */
   void
-  formatItemXml(std::ostream& os, const ForwarderStatus& item, const Name& nfdId) const;
+  formatItemXml(std::ostream& os, const ForwarderStatus& item) const;
 
   void
   formatStatusText(std::ostream& os) const override;
@@ -74,67 +62,14 @@
   /** \brief format a single status item as text
    *  \param os output stream
    *  \param item status item
-   *  \param nfdId NFD's signing certificate name
    */
   void
-  formatItemText(std::ostream& os, const ForwarderStatus& item, const Name& nfdId) const;
+  formatItemText(std::ostream& os, const ForwarderStatus& item) const;
 
 private:
-  const Name&
-  getNfdId() const;
-
-private:
-  const NfdIdCollector* m_nfdIdCollector;
   ForwarderStatus m_status;
 };
 
-
-/** \brief a validator that can collect NFD's signing certificate name
- *
- *  This validator redirects all validation requests to an inner validator.
- *  For the first Data packet accepted by the inner validator that has a Name in KeyLocator,
- *  this Name is collected as NFD's signing certificate name.
- *
- *  \todo #4089 re-implement as v2 ValidationPolicy
- */
-class NfdIdCollector : public ndn::Validator
-{
-public:
-  explicit
-  NfdIdCollector(unique_ptr<ndn::Validator> inner);
-
-  bool
-  hasNfdId() const
-  {
-    return m_hasNfdId;
-  }
-
-  const Name&
-  getNfdId() const;
-
-protected:
-  void
-  checkPolicy(const Interest& interest, int nSteps,
-              const ndn::OnInterestValidated& accept,
-              const ndn::OnInterestValidationFailed& reject,
-              std::vector<shared_ptr<ndn::ValidationRequest>>& nextSteps) override
-  {
-    BOOST_ASSERT(nSteps == 0);
-    m_inner->validate(interest, accept, reject);
-  }
-
-  void
-  checkPolicy(const Data& data, int nSteps,
-              const ndn::OnDataValidated& accept,
-              const ndn::OnDataValidationFailed& reject,
-              std::vector<shared_ptr<ndn::ValidationRequest>>& nextSteps) override;
-
-private:
-  unique_ptr<ndn::Validator> m_inner;
-  bool m_hasNfdId;
-  Name m_nfdId;
-};
-
 } // namespace nfdc
 } // namespace tools
 } // namespace nfd
diff --git a/tools/nfdc/status.cpp b/tools/nfdc/status.cpp
index 529ee82..01222c8 100644
--- a/tools/nfdc/status.cpp
+++ b/tools/nfdc/status.cpp
@@ -40,17 +40,10 @@
 void
 reportStatus(ExecuteContext& ctx, const StatusReportOptions& options)
 {
-  unique_ptr<ndn::security::v2::Validator> validator = make_unique<ndn::security::v2::ValidatorNull>();
-  CommandOptions ctrlOptions;
-
   StatusReport report;
 
   if (options.wantForwarderGeneral) {
-    // auto nfdIdCollector = make_unique<NfdIdCollector>(std::move(validator));
-    auto forwarderGeneralModule = make_unique<ForwarderGeneralModule>();
-    // forwarderGeneralModule->setNfdIdCollector(*nfdIdCollector);
-    report.sections.push_back(std::move(forwarderGeneralModule));
-    // validator = std::move(nfdIdCollector);
+    report.sections.push_back(make_unique<ForwarderGeneralModule>());
   }
 
   if (options.wantChannels) {
@@ -73,7 +66,9 @@
     report.sections.push_back(make_unique<StrategyChoiceModule>());
   }
 
-  uint32_t code = report.collect(ctx.face, ctx.keyChain, *validator, ctrlOptions);
+  uint32_t code = report.collect(ctx.face, ctx.keyChain,
+                                 ndn::security::v2::getAcceptAllValidator(),
+                                 CommandOptions());
   if (code != 0) {
     ctx.exitCode = 1;
     // Give a simple error code for end user.
