*/
#include "inspircd.h"
-
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
-
-#include "inspircd_config.h"
-#include "configreader.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
-#include "socket.h"
-#include "hashcomp.h"
#include "transport.h"
#include "m_cap.h"
class issl_session : public classbase
{
public:
+ issl_session()
+ {
+ sess = NULL;
+ }
+
gnutls_session_t sess;
issl_status status;
std::string outbuf;
if((ret = gnutls_certificate_set_x509_key_file (x509_cred, certfile.c_str(), keyfile.c_str(), GNUTLS_X509_FMT_PEM)) < 0)
{
// If this fails, no SSL port will work. At all. So, do the smart thing - throw a ModuleException
- throw ModuleException("Unable to load GnuTLS server certificate: " + std::string(gnutls_strerror(ret)));
+ throw ModuleException("Unable to load GnuTLS server certificate (" + std::string(certfile) + ", key: " + keyfile + "): " + std::string(gnutls_strerror(ret)));
}
// This may be on a large (once a day or week) timer eventually.
void OnEvent(Event* ev)
{
GenericCapHandler(ev, "tls", "tls");
- if (ev->GetEventID() == "cap_req")
- {
- /* GenericCapHandler() Extends("tls") a user if it does
- * CAP REQ tls. Check if this was done.
- */
- CapData *data = (CapData *) ev->GetData();
- if (data->user->Shrink("tls"))
- {
- /* Not in our spec?!?! */
- data->user->AddIOHook(this);
- OnRawSocketAccept(data->user->GetFd(), data->user->GetIPString(),
- data->user->GetPort());
- }
- }
}
void Prioritize()