summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-03-14 10:49:19 +0000
committerPeter Powell <petpow@saberuk.com>2019-03-14 10:52:13 +0000
commit62ba7c3917955b27b7967ccde0dc55b947e04782 (patch)
treed21c48eba2a3d26e853c46ee15a8e892865badc4
parentb518f45d72e2c7bd38d4ecf155efbf4046c3f57c (diff)
Generate the ssl_cert metadata before bursting a connecting user.
-rw-r--r--src/modules/m_spanningtree/main.cpp5
-rw-r--r--src/modules/m_spanningtree/main.h4
2 files changed, 9 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index de1e8eb19..920840f9b 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -45,6 +45,7 @@ ModuleSpanningTree::ModuleSpanningTree()
, commands(this)
, currmembid(0)
, eventprov(this, "event/server")
+ , sslapi(this)
, DNS(this, "DNS")
, tagevprov(this, "event/messagetag")
, loopCall(false)
@@ -447,6 +448,10 @@ void ModuleSpanningTree::OnUserConnect(LocalUser* user)
if (user->quitting)
return;
+ // Create the lazy ssl_cert metadata for this user if not already created.
+ if (sslapi)
+ sslapi->GetCertificate(user);
+
CommandUID::Builder(user).Broadcast();
if (user->IsOper())
diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h
index fa2928687..ec97e73be 100644
--- a/src/modules/m_spanningtree/main.h
+++ b/src/modules/m_spanningtree/main.h
@@ -26,6 +26,7 @@
#include "inspircd.h"
#include "event.h"
#include "modules/dns.h"
+#include "modules/ssl.h"
#include "modules/stats.h"
#include "servercommand.h"
#include "commands.h"
@@ -80,6 +81,9 @@ class ModuleSpanningTree
*/
Events::ModuleEventProvider eventprov;
+ /** API for accessing user SSL certificates. */
+ UserCertificateAPI sslapi;
+
public:
dynamic_reference<DNS::Manager> DNS;