summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-07-25 12:10:07 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-07-25 12:10:07 +0200
commitbabce517d1d9a82b13365a17e15237470daf5ced (patch)
treed07fd0e81b0847c48721d094ed03334bee693118 /src/modules/extra
parentf62654a6859998f9d63eb22702c572d5ebcff15c (diff)
m_ssl_openssl Read the DH params file using the BIO API on all OSes
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index afead64d8..dab59ffa6 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -69,21 +69,13 @@ namespace OpenSSL
public:
DHParams(const std::string& filename)
{
-#ifdef _WIN32
BIO* dhpfile = BIO_new_file(filename.c_str(), "r");
-#else
- FILE* dhpfile = fopen(filename.c_str(), "r");
-#endif
if (dhpfile == NULL)
- throw Exception("Couldn't open DH file " + filename + ": " + strerror(errno));
+ throw Exception("Couldn't open DH file " + filename);
-#ifdef _WIN32
dh = PEM_read_bio_DHparams(dhpfile, NULL, NULL, NULL);
BIO_free(dhpfile);
-#else
- dh = PEM_read_DHparams(dhpfile, NULL, NULL, NULL);
- fclose(dhpfile);
-#endif
+
if (!dh)
throw Exception("Couldn't read DH params from file " + filename);
}