summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/server_status.cpp
diff options
context:
space:
mode:
authormelissaosullivan <melissakellyosullivan@gmail.com>2014-07-28 17:47:45 -0400
committerBenety Goh <benety@mongodb.com>2014-08-08 16:27:20 -0400
commitff1c6fd66530866cd04e2a8e40e368b9f565ee34 (patch)
treeb6107a7eb10d88cb43f7c7a68b50c67c61d13aaa /src/mongo/db/commands/server_status.cpp
parentdaab6fae496e1aca6b8f7c709bd18307745df1dd (diff)
downloadmongo-ff1c6fd66530866cd04e2a8e40e368b9f565ee34.tar.gz
SERVER-14836 SSL certificate expiration date in db.serverStatus()
Closes #738 Signed-off-by: Benety Goh <benety@mongodb.com>
Diffstat (limited to 'src/mongo/db/commands/server_status.cpp')
-rw-r--r--src/mongo/db/commands/server_status.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mongo/db/commands/server_status.cpp b/src/mongo/db/commands/server_status.cpp
index e5d9a791589..49a4cacb303 100644
--- a/src/mongo/db/commands/server_status.cpp
+++ b/src/mongo/db/commands/server_status.cpp
@@ -43,6 +43,7 @@
#include "mongo/db/stats/counters.h"
#include "mongo/platform/process_id.h"
#include "mongo/util/net/listen.h"
+#include "mongo/util/net/ssl_manager.h"
#include "mongo/util/processinfo.h"
#include "mongo/util/ramlog.h"
#include "mongo/util/version.h"
@@ -257,6 +258,24 @@ namespace mongo {
} network;
+#ifdef MONGO_SSL
+ class Security : public ServerStatusSection {
+ public:
+ Security() : ServerStatusSection( "security" ) {}
+ virtual bool includeByDefault() const { return true; }
+
+ BSONObj generateSection(const BSONElement& configElement) const {
+ BSONObjBuilder security;
+ if (getSSLManager()) {
+ security.appendDate( "SSLCertificateExpirationDate",
+ getSSLManager()->getServerCertificateExpirationDate() );
+ }
+
+ return security.obj();
+ }
+ } security;
+#endif
+
class MemBase : public ServerStatusMetric {
public:
MemBase() : ServerStatusMetric(".mem.bits") {}