MXS-2650 Fix SSL-use with Connector-C

Authenticators and monitors now use SSL when configured. The fix has two parts:
1) Removed the extra SSLConfig inside SSLProvider, as SSLContext already contains
the config.
2) When inputting parameter values to mysql_ssl_set(), empty strings are converted
to NULL-pointers as the function expects those for unused values.
This commit is contained in:
Esa Korhonen
2019-08-28 15:37:23 +03:00
parent 96e81a6b59
commit 68f3b235e1
6 changed files with 31 additions and 29 deletions

View File

@ -77,6 +77,9 @@ struct SSLConfig
return ca.empty();
}
// Convert to human readable string representation
std::string to_string() const;
std::string key; /**< SSL private key */
std::string cert; /**< SSL certificate */
std::string ca; /**< SSL CA certificate */
@ -144,20 +147,16 @@ public:
return m_context.get();
}
// Current configuration
const mxs::SSLConfig& config() const;
// Current configuration, or null if none is set.
const mxs::SSLConfig* config() const;
// The context or nullptr if no context is set
mxs::SSLContext* context() const;
// Convert to human readable string representation
std::string to_string() const;
// NOTE: Do not use this, required by binlogrouter
void set_context(std::unique_ptr<mxs::SSLContext> ssl);
private:
std::unique_ptr<mxs::SSLContext> m_context; /**< SSL context */
mxs::SSLConfig m_config; /**< SSL configuration */
};
}