LS/SSL error: SSL is required, but the server does not support it
-
Hi,
in a CI script, when I use this command:
wp db query "SELECT COUNT(*) FROM ${WORDPRESS_TABLE_PREFIX}users" --allow-root --skip-column-namesI get the following error if the server doesn’t support SSL:
Error: Failed to get current SQL modes. Reason: ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support itI would like to use this command in both scenarios: when the server supports SSL and when it does not.
I’ve tried the following approaches, but none of them work:
- Using
wp db querywith the flag--ssl-mode=DISABLED. - Adding to
wp-config.phpthe values:
define('DB_SSL', false);
define('MYSQL_CLIENT_FLAGS', 0);Adding the following to the MariaDB client configuration:
[client-mariadb]
disable-ssl-verify-server-cert<span style=”font-size: inherit;”>I am using a Docker container for WordPress: </span><code data-start=”957″ data-end=”973″>php:8.2-apache<span style=”font-size: inherit;”> with WP-CLI and </span><code data-start=”990″ data-end=”1006″>mariadb-client<span style=”font-size: inherit;”> installed.</span>
The following command works:
<span style="font-size: inherit;"> wp db check --allow-root --path="$WP_CORE_PATH" --skip-ssl </span>Is there a way to enable and disable the use of SSL using wp cli ?
Thank you
Claudio
- Using
You must be logged in to reply to this topic.