From 68ad51bc52bdaa34973c2782c3c6812ab18c62c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 20 May 2019 13:22:15 +0300 Subject: [PATCH] MXS-2483: Address review comments --- server/core/config.cc | 1 + server/core/ssl.cc | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/server/core/config.cc b/server/core/config.cc index c90a86f1c..401ce29f5 100644 --- a/server/core/config.cc +++ b/server/core/config.cc @@ -2862,6 +2862,7 @@ bool config_create_ssl(const char* name, mxs::SSLContext** dest) { bool ok = true; + *dest = nullptr; // The enum values convert to bool int value = params.get_enum(CN_SSL, ssl_values); diff --git a/server/core/ssl.cc b/server/core/ssl.cc index bd5c27103..8776f1ee0 100644 --- a/server/core/ssl.cc +++ b/server/core/ssl.cc @@ -238,7 +238,7 @@ SSLContext::SSLContext(const std::string& key, const std::string& cert, const st std::string SSLContext::serialize() const { - std::stringstream ss; + std::ostringstream ss; ss << "ssl=required\n"; if (!m_cert.empty()) @@ -267,7 +267,7 @@ bool SSLContext::init() { #ifndef OPENSSL_1_1 case SERVICE_TLS10: - method = (SSL_METHOD*)TLSv1_method(); + m_method = (SSL_METHOD*)TLSv1_method(); break; #endif @@ -398,7 +398,7 @@ json_t* SSLContext::to_json() const std::string SSLContext::to_string() const { - std::stringstream ss; + std::ostringstream ss; ss << "\tSSL initialized: yes\n" << "\tSSL method type: " << ssl_method_type_to_string(m_version) << "\n"