| | 1370 | // call set_ssl if mysql client flag set |
| | 1371 | if ( $client_flags & MYSQL_CLIENT_SSL ) { |
| | 1372 | $pack = array( $this->dbh ); |
| | 1373 | $call_set = false; |
| | 1374 | foreach( array( 'MYSQL_SSL_KEY', 'MYSQL_SSL_CERT', 'MYSQL_SSL_CA', |
| | 1375 | 'MYSQL_SSL_CAPATH', 'MYSQL_SSL_CIPHER' ) as $opt_key ) { |
| | 1376 | $pack[] = ( defined( $opt_key ) ) ? constant( $opt_key ) : null; |
| | 1377 | $call_set |= defined( $opt_key ); |
| | 1378 | } |
| | 1379 | /* Now if anything was packed - unpack into the function. |
| | 1380 | * Note this doesn't check if paths exist, as per the PHP doc |
| | 1381 | * at http://www.php.net/manual/en/mysqli.ssl-set.php: "This |
| | 1382 | * function always returns TRUE value. If SSL setup is incorrect |
| | 1383 | * mysqli_real_connect() will return an error ..." |
| | 1384 | */ |
| | 1385 | if ( $call_set ) { // SSL added here! |
| | 1386 | call_user_func_array( 'mysqli_ssl_set', $pack ); |
| | 1387 | } |
| | 1388 | } |
| | 1389 | |