Merge branch '2.3' into 2.4

This commit is contained in:
Markus Mäkelä 2020-01-17 09:24:42 +02:00
commit df3ae56952
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
3 changed files with 18 additions and 20 deletions

View File

@ -1979,13 +1979,14 @@ This section describes configuration parameters for both servers and listeners
that control the TLS/SSL encryption method and the various certificate files
involved in it.
To enable TLS/SSL for a listener, you must set the `ssl` parameter to `true`
and provide the three files for `ssl_cert`, `ssl_key` and `ssl_ca_cert`.
To enable TLS/SSL for a listener, you must set the `ssl` parameter to
`true` and provide at least the `ssl_cert` and `ssl_key` parameters.
To enable TLS/SSL for a server, you must set the `ssl` parameter to `required`
and provide at least the `ssl_ca_cert` parameter. If the backend database server
has certificate verification enabled, the `ssl_cert` and `ssl_key` parameters
must also be defined.
To enable TLS/SSL for a server, you must set the `ssl` parameter to
`true`. If the backend database server has certificate verification
enabled, the `ssl_cert` and `ssl_key` parameters must also be defined.
Custom CA certificates can be defined with the `ssl_ca_cert` parameter.
After this, MaxScale connections between the server and/or the client will be
encrypted. Note that the database must also be configured to use TLS/SSL

View File

@ -2889,15 +2889,6 @@ bool config_create_ssl(const char* name,
if (value)
{
if (!params.contains(CN_SSL_CA_CERT))
{
MXS_ERROR("CA Certificate missing for '%s'."
"Please provide the path to the certificate authority "
"certificate by adding the ssl_ca_cert=<path> parameter",
name);
ok = false;
}
if (require_cert)
{
if (!params.contains(CN_SSL_CERT))

View File

@ -335,12 +335,18 @@ bool SSLContext::init()
SSL_CTX_set_tmp_rsa_callback(m_ctx, tmp_rsa_callback);
}
mxb_assert(!m_cfg.ca.empty());
/* Load the CA certificate into the SSL_CTX structure */
if (!SSL_CTX_load_verify_locations(m_ctx, m_cfg.ca.c_str(), NULL))
if (!m_cfg.ca.empty())
{
MXS_ERROR("Failed to set Certificate Authority file: %s", get_ssl_errors());
/* Load the CA certificate into the SSL_CTX structure */
if (!SSL_CTX_load_verify_locations(m_ctx, m_cfg.ca.c_str(), NULL))
{
MXS_ERROR("Failed to set Certificate Authority file: %s", get_ssl_errors());
return false;
}
}
else if (SSL_CTX_set_default_verify_paths(m_ctx) == 0)
{
MXS_ERROR("Failed to set default CA verify paths: %s", get_ssl_errors());
return false;
}