I would like to use multiple flags for mysqli_real_connect options. That is MYSQLI_CLIENT_COMPRESS and MYSQLI_CLIENT_SSL.
Tried passing the flags as an array as well as comma separated string. Both fail.
Here is how I am connecting, with MYSQLI_CLIENT_SSL flag:
$ssl->init();
if(!$ssl){die('Failed to initialise mysqli');}
$ssl->ssl_set(NULL,NULL,NULL,"c:\\inetpub\\wwwroot\\path_to_ca_certificates_folder","DHE-RSA-AES256-SHA") or die('Failed to set SSL');
$ssl->options(MYSQLI_OPT_CONNECT_TIMEOUT,5) or die('Setting MYSQLI_OPT_CONNECT_TIMEOUT failed');
if(!$ssl->real_connect('host.url','username','password','dbname',3306,NULL,MYSQLI_CLIENT_SSL)){
die('Real connect failed: '.$ssl->connect_error);
}else{
#do whatever
}
$ssl->close();
How do I ensure the connection is over SSL as well as the response is compressed?