]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ssl_gnutls.cpp
Move configuration examples to docs, remove automatic overwrite on make install
[user/henk/code/inspircd.git] / src / modules / extra / m_ssl_gnutls.cpp
index 374431752ccdb5c39b6e6c257b0839876a882877..a0804ddf9a6e27fc2e3782eb0e9b47ee86c95d34 100644 (file)
@@ -24,8 +24,6 @@
 /* $ModDesc: Provides SSL support for clients */
 /* $CompileFlags: pkgconfincludes("gnutls","/gnutls/gnutls.h","") */
 /* $LinkerFlags: rpath("pkg-config --libs gnutls") pkgconflibs("gnutls","/libgnutls.so","-lgnutls") */
-/* $CopyInstall: conf/key.pem $(CONPATH) -m 0400 -o $(INSTUID) */
-/* $CopyInstall: conf/cert.pem $(CONPATH) -m 0444 */
 
 enum issl_status { ISSL_NONE, ISSL_HANDSHAKING_READ, ISSL_HANDSHAKING_WRITE, ISSL_HANDSHAKEN, ISSL_CLOSING, ISSL_CLOSED };
 
@@ -105,6 +103,15 @@ class CommandStartTLS : public SplitCommand
                        if (!user->eh.GetIOHook())
                        {
                                user->WriteNumeric(670, "%s :STARTTLS successful, go ahead with TLS handshake", user->nick.c_str());
+                               /* We need to flush the write buffer prior to adding the IOHook,
+                                * otherwise we'll be sending this line inside the SSL session - which
+                                * won't start its handshake until the client gets this line. Currently,
+                                * we assume the write will not block here; this is usually safe, as
+                                * STARTTLS is sent very early on in the registration phase, where the
+                                * user hasn't built up much sendq. Handling a blocked write here would
+                                * be very annoying.
+                                */
+                               user->eh.DoWrite();
                                user->eh.AddIOHook(creator);
                                creator->OnStreamSocketAccept(&user->eh, NULL, NULL);
                        }