Easy Tutorial
❮ Func Filesystem Dirname Func Filesystem Is Writable ❯

PHP mysqli_ssl_set() Function

PHP MySQLi Reference Manual

Example

Creating an SSL connection:


Definition and Usage

The mysqli_ssl_set() function is used to establish an SSL secure connection. However, this function only works if OpenSSL support is enabled.

Note: This function must be called before mysqli_real_connect().

Note: Prior to PHP 5.3.3, the MySQL Native Driver did not support SSL. Since PHP 5.3+, the MySQL Native Driver is enabled by default on Microsoft Windows.


Syntax

Parameter Description
connection Required. Specifies the MySQL connection to use.
key Required. Specifies the path name to the key file.
cert Required. Specifies the path name to the certificate file.
ca Required. Specifies the path name to the certificate authority file.
capath Required. Specifies the path name to a directory containing trusted SSL CA certificates in PEM format.
cipher Required. Specifies a list of allowable ciphers to use for SSL encryption.

Technical Details

Return Value: Always returns TRUE. If SSL is not set up correctly, mysqli_real_connect() will fail when you attempt to connect.
PHP Version: 5+
--- ---
❮ Func Filesystem Dirname Func Filesystem Is Writable ❯