Despite native driver (mysqlnd 8.3.20) and MySQL >5.6, the flag

MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT

will cause connection to be rejected as “not secure”, if server is set to require SSL connection (–require-secure-transport=ON).

It appears that MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT is seemingly accepted, but will not actually initiate a secure connection.

Similarly, if one tries to turn off certificate validation by setting options:

$mysqli->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, 0)

then this will return “false”, indicating that the option setting was not successful.