MXS-2861: Add ssl_cipher to servers and listeners
This allows the set of TLSv1.2 ciphers to be selected which is required to fulfill certain regulatory requirements.
This commit is contained in:
@ -201,6 +201,7 @@ SSLConfig::SSLConfig(const MXS_CONFIG_PARAMETER& params)
|
||||
, version((ssl_method_type_t)params.get_enum(CN_SSL_VERSION, ssl_version_values))
|
||||
, verify_depth(params.get_integer(CN_SSL_CERT_VERIFY_DEPTH))
|
||||
, verify_peer(params.get_bool(CN_SSL_VERIFY_PEER_CERTIFICATE))
|
||||
, cipher(params.get_string(CN_SSL_CIPHER))
|
||||
{
|
||||
}
|
||||
|
||||
@ -384,6 +385,15 @@ bool SSLContext::init()
|
||||
/* Set the verification depth */
|
||||
SSL_CTX_set_verify_depth(m_ctx, m_cfg.verify_depth);
|
||||
|
||||
if (!m_cfg.cipher.empty())
|
||||
{
|
||||
if (SSL_CTX_set_cipher_list(m_ctx, m_cfg.cipher.c_str()) == 0)
|
||||
{
|
||||
MXS_ERROR("Could not set cipher list '%s': %s", m_cfg.cipher.c_str(), get_ssl_errors());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user