MXS-2483: Take SSLProvider into use
Servers and listeners now have a SSLProvider member variable that is used for all SSL related tasks.
This commit is contained in:
@ -143,11 +143,6 @@ public:
|
||||
*/
|
||||
const char* state() const;
|
||||
|
||||
/**
|
||||
* The mxs::SSLContext object
|
||||
*/
|
||||
mxs::SSLContext* ssl_context() const;
|
||||
|
||||
/**
|
||||
* Convert to JSON
|
||||
*
|
||||
@ -191,6 +186,16 @@ public:
|
||||
struct users* users() const;
|
||||
void set_users(struct users* u);
|
||||
|
||||
const mxs::SSLProvider& ssl() const
|
||||
{
|
||||
return m_ssl_provider;
|
||||
}
|
||||
|
||||
mxs::SSLProvider& ssl()
|
||||
{
|
||||
return m_ssl_provider;
|
||||
}
|
||||
|
||||
private:
|
||||
enum State
|
||||
{
|
||||
@ -210,14 +215,13 @@ private:
|
||||
std::string m_auth_options; /**< Authenticator options */
|
||||
void* m_auth_instance; /**< Authenticator instance */
|
||||
|
||||
std::unique_ptr<mxs::SSLContext> m_ssl_context; /**< SSL context */
|
||||
|
||||
struct users* m_users; /**< The user data for this listener */
|
||||
SERVICE* m_service; /**< The service which used by this listener */
|
||||
std::atomic<bool> m_active; /**< True if the port has not been deleted */
|
||||
MXS_PROTOCOL m_proto_func; /**< Preloaded protocol functions */
|
||||
MXS_AUTHENTICATOR m_auth_func; /**< Preloaded authenticator functions */
|
||||
MXS_CONFIG_PARAMETER m_params; /**< Configuration parameters */
|
||||
mxs::SSLProvider m_ssl_provider;
|
||||
|
||||
Type m_type; /**< The type of the listener */
|
||||
|
||||
|
@ -517,26 +517,20 @@ public:
|
||||
*/
|
||||
void response_time_add(double ave, int num_samples);
|
||||
|
||||
const mxs::SSLConfig& ssl_config() const
|
||||
const mxs::SSLProvider& ssl() const
|
||||
{
|
||||
return m_ssl_config;
|
||||
return m_ssl_provider;
|
||||
}
|
||||
|
||||
mxs::SSLContext* ssl_context() const
|
||||
mxs::SSLProvider& ssl()
|
||||
{
|
||||
return m_ssl_context.get();
|
||||
}
|
||||
|
||||
void set_ssl_context(std::unique_ptr<mxs::SSLContext> ssl)
|
||||
{
|
||||
m_ssl_context.swap(ssl);
|
||||
m_ssl_config = m_ssl_context->config();
|
||||
return m_ssl_provider;
|
||||
}
|
||||
|
||||
protected:
|
||||
SERVER(std::unique_ptr<mxs::SSLContext> ssl_context)
|
||||
: m_response_time{0.04, 0.35, 500}
|
||||
, m_ssl_context{std::move(ssl_context)}
|
||||
, m_ssl_provider{std::move(ssl_context)}
|
||||
{
|
||||
}
|
||||
|
||||
@ -544,7 +538,5 @@ private:
|
||||
static const int DEFAULT_CHARSET = 0x08; /**< The latin1 charset */
|
||||
maxbase::EMAverage m_response_time; /**< Response time calculations for this server */
|
||||
std::mutex m_average_write_mutex; /**< Protects response time from concurrent writing */
|
||||
|
||||
std::unique_ptr<mxs::SSLContext> m_ssl_context; /**< SSL context */
|
||||
mxs::SSLConfig m_ssl_config; /**< SSL configuration */
|
||||
mxs::SSLProvider m_ssl_provider;
|
||||
};
|
||||
|
Reference in New Issue
Block a user