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:
@ -1481,7 +1481,7 @@ static void diagnostics(MXS_ROUTER* router, DCB* dcb)
|
||||
|
||||
if (ssl.enabled())
|
||||
{
|
||||
dcb_printf(dcb, "%s", ssl.to_string().c_str());
|
||||
dcb_printf(dcb, "%s", ssl.config()->to_string().c_str());
|
||||
}
|
||||
|
||||
/* Binlog Encryption options */
|
||||
|
@ -4852,24 +4852,24 @@ static void blr_master_get_config(ROUTER_INSTANCE* router, MasterServerConfig* c
|
||||
/* SSL options */
|
||||
auto server_ssl = router->service->dbref->server->ssl().config();
|
||||
|
||||
if (!server_ssl.empty())
|
||||
if (server_ssl && !server_ssl->empty())
|
||||
{
|
||||
curr_master->ssl_enabled = router->ssl_enabled;
|
||||
if (router->ssl_version)
|
||||
{
|
||||
curr_master->ssl_version = router->ssl_version;
|
||||
}
|
||||
if (!server_ssl.key.empty())
|
||||
if (!server_ssl->key.empty())
|
||||
{
|
||||
curr_master->ssl_key = server_ssl.key;
|
||||
curr_master->ssl_key = server_ssl->key;
|
||||
}
|
||||
if (!server_ssl.cert.empty())
|
||||
if (!server_ssl->cert.empty())
|
||||
{
|
||||
curr_master->ssl_cert = server_ssl.cert;
|
||||
curr_master->ssl_cert = server_ssl->cert;
|
||||
}
|
||||
if (!server_ssl.ca.empty())
|
||||
if (!server_ssl->ca.empty())
|
||||
{
|
||||
curr_master->ssl_ca = server_ssl.ca;
|
||||
curr_master->ssl_ca = server_ssl->ca;
|
||||
}
|
||||
}
|
||||
/* Connect options */
|
||||
|
Reference in New Issue
Block a user