]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_connect.c
Pretty symlink logic for help files
[irc/rqf/shadowircd.git] / modules / m_connect.c
index 34f9c0069812687ee73d4ff9b2d7a58fa27f5d72..3b8e4d593894afa3322f36d930b325eb7853d9cb 100644 (file)
 #include "stdinc.h"
 #include "client.h"
 #include "ircd.h"
-#include "irc_string.h"
+#include "match.h"
 #include "numeric.h"
-#include "commio.h"
 #include "s_conf.h"
 #include "s_newconf.h"
-#include "s_log.h"
+#include "logger.h"
 #include "s_serv.h"
 #include "send.h"
 #include "msg.h"
 #include "parse.h"
 #include "hash.h"
 #include "modules.h"
+#include "sslproc.h"
 
 static int mo_connect(struct Client *, struct Client *, int, const char **);
 static int ms_connect(struct Client *, struct Client *, int, const char **);
@@ -98,6 +98,14 @@ mo_connect(struct Client *client_p, struct Client *source_p, int parc, const cha
                return 0;
        }
 
+       if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count()))
+       {
+               sendto_one_notice(source_p,
+                                 ":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.",
+                                 parv[1]);
+               return 0;
+       }
+
        /*
         * Get port number from user, if given. If not specified,
         * use the default form configuration structure. If missing
@@ -192,6 +200,14 @@ ms_connect(struct Client *client_p, struct Client *source_p, int parc, const cha
                return 0;
        }
 
+       if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count()))
+       {
+               sendto_one_notice(source_p,
+                                 ":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.",
+                                 parv[1]);
+               return 0;
+       }
+
        /*
         * Get port number from user, if given. If not specified,
         * use the default form configuration structure. If missing
@@ -219,9 +235,6 @@ ms_connect(struct Client *client_p, struct Client *source_p, int parc, const cha
        sendto_server(NULL, NULL, CAP_TS6, NOCAPS,
                      ":%s WALLOPS :Remote CONNECT %s %d from %s",
                      me.id, parv[1], port, source_p->name);
-       sendto_server(NULL, NULL, NOCAPS, CAP_TS6,
-                     ":%s WALLOPS :Remote CONNECT %s %d from %s",
-                     me.name, parv[1], port, source_p->name);
 
        ilog(L_SERVER, "CONNECT From %s : %s %d", source_p->name, parv[1], port);