From babce517d1d9a82b13365a17e15237470daf5ced Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Fri, 25 Jul 2014 12:10:07 +0200 Subject: m_ssl_openssl Read the DH params file using the BIO API on all OSes --- src/modules/extra/m_ssl_openssl.cpp | 12 ++---------- 1 file 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); } -- cgit v1.2.3