MysqlndUhConnection::sslSet

(PECL mysqlnd-uh >= 1.0.0-alpha)

MysqlndUhConnection::sslSetUsed for establishing secure connections using SSL

说明

public MysqlndUhConnection::sslSet ( mysqlnd_connection $connection , string $key , string $cert , string $ca , string $capath , string $cipher ) : bool

Used for establishing secure connections using SSL.

参数

connection

Mysqlnd connection handle. Do not modify!

key

The path name to the key file.

cert

The path name to the certificate file.

ca

The path name to the certificate authority file.

capath

The pathname to a directory that contains trusted SSL CA certificates in PEM format.

cipher

A list of allowable ciphers to use for SSL encryption.

返回值

Returns TRUE on success. Otherwise, returns FALSE

范例

Example #1 MysqlndUhConnection::sslSet() example

<?php
class proxy extends MysqlndUhConnection {
 public function 
sslSet($conn$key$cert$ca$capath$cipher) {
  
printf("%s(%s)\n"__METHOD__var_export(func_get_args(), true));
  
$ret parent::sslSet($conn$key$cert$ca$capath$cipher);
  
printf("%s returns %s\n"__METHOD__var_export($rettrue));
  return 
$ret;
 }
}
mysqlnd_uh_set_connection_proxy(new proxy());
$mysqli = new mysqli("localhost""root""""test");
$mysqli->ssl_set("key""cert""ca""capath""cipher");
?>

以上例程会输出:

proxy::sslSet(array (
  0 => NULL,
  1 => 'key',
  2 => 'cert',
  3 => 'ca',
  4 => 'capath',
  5 => 'cipher',
))
proxy::sslSet returns true

参见

相关文章
php eventbufferevent returns version of cipher used by current ssl connectionphp eventbufferevent returns the name of the protocol used for current ssl connectionphp eio 函数 get stream representing a variable used in internal communications with libeiophp mcve 函数 ready the client for ip/ssl communicationphp maxdb 函数 used for establishing secure connections using sslphp ncurses 函数 stop using ncurses clean up the screenphp ncurses 函数 draw a horizontal line at current position using an attributed character and max. n characters longphp csprng 函数 generates cryptographically secure pseudo random bytesphp gmagickdraw sets the fill color to be used for drawing filled objectsphp imagick distorts an image using various distortion methodsphp imagickdraw returns the shape to be used at the end of open subpaths when they are strokedphp imagickdraw sets the width of the stroke used to draw object outlinesphp ldap using the php ldap callsphp mysqlnduhconnection returns a string representing the type of connection usedphp mysqlnduhconnection returns the auto generated id used in the last queryphp mysqlnduhconnection returns the version of the mysql protocol usedphp mysqlnduhconnection used for establishing secure connections using sslphp solrquery if true the result of the first field grouping command is used as the main result list in the response using group.format=simplephp swfshape draws the first character in the given string into the shape using the glyph definition from the given fontphp swoole server check all the connections on the server.
关注编程学问公众号