summaryrefslogtreecommitdiff
path: root/src/modules/ssl/m_ssl.cpp
diff options
context:
space:
mode:
authorNaram Qashat <cyberbotx@cyberbotx.com>2010-06-27 23:15:05 -0400
committerNaram Qashat <cyberbotx@cyberbotx.com>2010-06-27 23:15:05 -0400
commit28e12bc24a9c85f4f0d1e37567618ec39cb501f6 (patch)
treecc70ebeef95a9d95174afe3ef038b0d673346f58 /src/modules/ssl/m_ssl.cpp
parent051ebe3eea0f8529b64c0e443c61103ba2f7dee8 (diff)
The next of a few "CBX OCDing over code style" commits, maybe the last.
NOTES: I have been unable to compile the db_mysql_* functions on my system here, so those are untested. db-convert seems to be badly programmed and needs more work in my opinion.
Diffstat (limited to 'src/modules/ssl/m_ssl.cpp')
-rw-r--r--src/modules/ssl/m_ssl.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/modules/ssl/m_ssl.cpp b/src/modules/ssl/m_ssl.cpp
index be3e5da1f..5bc9870da 100644
--- a/src/modules/ssl/m_ssl.cpp
+++ b/src/modules/ssl/m_ssl.cpp
@@ -2,6 +2,7 @@
#include "module.h"
+#define OPENSSL_NO_SHA512
#include <openssl/bio.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
@@ -31,7 +32,7 @@ class SSLSocket : public Socket
SSLSocket(const std::string &nTargetHost, int nPort, const std::string &nBindHost = "", bool nIPv6 = false) : Socket(nTargetHost, nPort, nBindHost, nIPv6)
{
sslsock = SSL_new(ctx);
-
+
if (!sslsock)
throw CoreException("Unable to initialize SSL socket");
@@ -62,20 +63,13 @@ class SSLModule : public Module
public:
SSLModule(const std::string &modname, const std::string &creator) : Module(modname, creator)
{
- this->SetAuthor("Anope");
- this->SetVersion("$Id$");
- this->SetType(SUPPORTED);
- this->SetPermanent(true);
-
SSL_load_error_strings();
SSLeay_add_ssl_algorithms();
ctx = SSL_CTX_new(SSLv23_client_method());
if (!ctx)
- {
throw ModuleException("Error initializing SSL CTX");
- }
if (IsFile(CERTFILE))
{
@@ -86,9 +80,7 @@ class SSLModule : public Module
}
}
else
- {
Alog() << "m_ssl: No certificate file found";
- }
if (IsFile(KEYFILE))
{
@@ -106,11 +98,13 @@ class SSLModule : public Module
throw ModuleException("Error loading private key - file not found");
}
else
- {
Alog() << "m_ssl: No private key found";
- }
}
+ this->SetAuthor("Anope");
+ this->SetType(SUPPORTED);
+ this->SetPermanent(true);
+
SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2);
SSL_CTX_set_options(ctx, SSL_OP_TLS_ROLLBACK_BUG | SSL_OP_ALL);