Fixed typo in previous commit related to SSL and latency

Also testing SSL connection with hardcoded certificates
pull/642/head
René Cannaò 10 years ago
parent 9019c6b3d5
commit 41ee4e5b85

@ -404,11 +404,11 @@ bool MySQL_HostGroups_Manager::commit() {
}
if (atoi(r->fields[8])!=atoi(r->fields[16])) {
proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL, 5, "Changing use_ssl for server %s:%d (%s:%d) from %d (%d) to %d\n" , mysrvc->address, mysrvc->port, r->fields[1], atoi(r->fields[2]), r->fields[8] , mysrvc->use_ssl , atoi(r->fields[16]));
mysrvc->max_connections=atoi(r->fields[16]);
mysrvc->use_ssl=atoi(r->fields[16]);
}
if (atoi(r->fields[9])!=atoi(r->fields[17])) {
proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL, 5, "Changing max_latency_ms for server %s:%d (%s:%d) from %d (%d) to %d\n" , mysrvc->address, mysrvc->port, r->fields[1], atoi(r->fields[2]), r->fields[9] , mysrvc->max_latency_ms , atoi(r->fields[17]));
mysrvc->max_connections=atoi(r->fields[17]);
mysrvc->max_latency_ms=atoi(r->fields[17]);
}
}
}

@ -298,6 +298,9 @@ void MySQL_Connection::connect_start() {
mysql=mysql_init(NULL);
assert(mysql);
mysql_options(mysql, MYSQL_OPT_NONBLOCK, 0);
if (parent->use_ssl) {
mysql_ssl_set(mysql, "/home/vagrant/newcerts/client-key.pem","/home/vagrant/newcerts/client-cert.pem", NULL, NULL, NULL);
}
unsigned int timeout= 1;
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (void *)&timeout);
const CHARSET_INFO * c = proxysql_find_charset_nr(mysql_thread___default_charset);

Loading…
Cancel
Save