diff options
Diffstat (limited to 'modules/extra')
| -rw-r--r-- | modules/extra/m_sqlite.cpp | 11 | ||||
| -rw-r--r-- | modules/extra/m_ssl_openssl.cpp | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/modules/extra/m_sqlite.cpp b/modules/extra/m_sqlite.cpp index d8b76011a..0699ee3eb 100644 --- a/modules/extra/m_sqlite.cpp +++ b/modules/extra/m_sqlite.cpp @@ -138,7 +138,16 @@ SQLiteService::SQLiteService(Module *o, const Anope::string &n, const Anope::str { int db = sqlite3_open_v2(database.c_str(), &this->sql, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0); if (db != SQLITE_OK) - throw SQL::Exception("Unable to open SQLite database " + database + ": " + sqlite3_errmsg(this->sql)); + { + Anope::string exstr = "Unable to open SQLite database " + database; + if (this->sql) + { + exstr += ": "; + exstr += sqlite3_errmsg(this->sql); + sqlite3_close(this->sql); + } + throw SQL::Exception(exstr); + } } SQLiteService::~SQLiteService() diff --git a/modules/extra/m_ssl_openssl.cpp b/modules/extra/m_ssl_openssl.cpp index 00df168de..bdc3a5624 100644 --- a/modules/extra/m_ssl_openssl.cpp +++ b/modules/extra/m_ssl_openssl.cpp @@ -147,7 +147,7 @@ class SSLModule : public Module if (Anope::IsFile(this->certfile.c_str())) { - if (!SSL_CTX_use_certificate_file(client_ctx, this->certfile.c_str(), SSL_FILETYPE_PEM) || !SSL_CTX_use_certificate_file(server_ctx, this->certfile.c_str(), SSL_FILETYPE_PEM)) + if (!SSL_CTX_use_certificate_chain_file(client_ctx, this->certfile.c_str()) || !SSL_CTX_use_certificate_chain_file(server_ctx, this->certfile.c_str())) throw ConfigException("Error loading certificate"); else Log(LOG_DEBUG) << "m_ssl_openssl: Successfully loaded certificate " << this->certfile; |
