/* $ModDesc: Provides SSL support for clients */
/* $CompileFlags: `libgnutls-config --cflags` */
-/* $LinkerFlags: `libgnutls-config --libs` */
+/* $LinkerFlags: `libgnutls-config --libs` `perl ../gnutls_rpath.pl` */
enum issl_status { ISSL_NONE, ISSL_HANDSHAKING_READ, ISSL_HANDSHAKING_WRITE, ISSL_HANDSHAKEN, ISSL_CLOSING, ISSL_CLOSED };
// :kenny.chatspike.net 320 Om Epy|AFK :is a Secure Connection
virtual void OnWhois(userrec* source, userrec* dest)
{
- if(dest->GetExt("ssl"))
+ // Bugfix, only send this numeric for *our* SSL users
+ if(dest->GetExt("ssl") && isin(dest->port, listenports))
{
- WriteServ(source->fd, "320 %s %s :is a secure connection", source->nick, dest->nick);
+ WriteServ(source->fd, "320 %s %s :is using a secure connection", source->nick, dest->nick);
}
}
// This will do for setting the ssl flag...it could be done earlier if it's needed. But this seems neater.
userrec* extendme = Srv->FindDescriptor(session->fd);
- extendme->Extend("ssl", "ON");
+ if (extendme)
+ {
+ if (!extendme->GetExt("ssl"))
+ extendme->Extend("ssl", "ON");
+ }
// Change the seesion state
session->status = ISSL_HANDSHAKEN;