diff --git a/tests/tools/nfdc/forwarder-general-module.t.cpp b/tests/tools/nfdc/forwarder-general-module.t.cpp
index f97d36d..b621bb4 100644
--- a/tests/tools/nfdc/forwarder-general-module.t.cpp
+++ b/tests/tools/nfdc/forwarder-general-module.t.cpp
@@ -24,10 +24,11 @@
  */
 
 #include "nfdc/forwarder-general-module.hpp"
-#include <ndn-cxx/security/signing-helpers.hpp>
 
 #include "status-fixture.hpp"
 
+#include <ndn-cxx/security/signing-helpers.hpp>
+
 namespace nfd {
 namespace tools {
 namespace nfdc {
@@ -36,38 +37,8 @@
 BOOST_AUTO_TEST_SUITE(Nfdc)
 BOOST_FIXTURE_TEST_SUITE(TestForwarderGeneralModule, StatusFixture<ForwarderGeneralModule>)
 
-// class MakeNfdIdCollector
-// {
-// public:
-//   unique_ptr<NfdIdCollector>
-//   operator()(Face&, KeyChain&) const
-//   {
-//     return make_unique<NfdIdCollector>(make_unique<ValidatorNull>());
-//   };
-// };
-
-class ForwarderGeneralStatusFixture : public StatusFixture<ForwarderGeneralModule>
-{
-protected:
-  ForwarderGeneralStatusFixture()
-  {
-    // module.setNfdIdCollector(*validator);
-
-    BOOST_REQUIRE(this->addIdentity("/nfd-status/test-nfdid",
-                                    ndn::EcKeyParams(name::Component("KEYID"))));
-  }
-
-private:
-  void
-  signDatasetReply(Data& data) override
-  {
-    m_keyChain.sign(data, ndn::security::signingByIdentity("/nfd-status/test-nfdid"));
-  }
-};
-
 const std::string STATUS_XML = stripXmlSpaces(R"XML(
   <generalStatus>
-    <nfdId>/nfdId-unavailable</nfdId>
     <version>0.4.1-1-g704430c</version>
     <startTime>2016-06-24T15:13:46.856000</startTime>
     <currentTime>2016-07-17T17:55:54.109000</currentTime>
@@ -94,7 +65,6 @@
 
 const std::string STATUS_TEXT = std::string(R"TEXT(
 General NFD status:
-                 nfdId=/nfdId-unavailable
                version=0.4.1-1-g704430c
              startTime=20160624T151346.856000
            currentTime=20160717T175554.109000
@@ -112,7 +82,7 @@
              nOutNacks=26762
 )TEXT").substr(1);
 
-BOOST_FIXTURE_TEST_CASE(Status, ForwarderGeneralStatusFixture)
+BOOST_AUTO_TEST_CASE(Status)
 {
   this->fetchStatus();
   ForwarderStatus payload;
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.
