Hello everyone,
The installation process fails directly when I enforce SSL for MySQL.
Steps to reproduce
- Configure MySQL to force SSL connections
CREATE USER ... REQUIRE SSL
- Edit
config.php to tell the driver the certificates' location
<?php
$CONFIG = array (
...
'dbdriveroptions' => array(
PDO::MYSQL_ATTR_SSL_KEY =>'/etc/xxx',
PDO::MYSQL_ATTR_SSL_CERT =>'/etc/xxx',
PDO::MYSQL_ATTR_SSL_CA => '/etc/xxx',
PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false,
),
...
);
Use occ to install
occ maintenance:install \
--database "mysql" \
--database-name "db_name" \
--database-host=127.0.0.1 \
--database-user "user" --database-pass "password" \
--admin-user "user" --admin-pass "password"
Actual behaviour
The installation fails with
Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'USER'@'%' (using password: YES)
and occ maintenance:install modifies the config.php file, turning this part:
'dbdriveroptions' => array(
PDO::MYSQL_ATTR_SSL_KEY =>'/etc/xxx',
PDO::MYSQL_ATTR_SSL_CERT =>'/etc/xxx',
PDO::MYSQL_ATTR_SSL_CA => '/etc/xxx',
PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false,
),
into
'dbdriveroptions' => array(
1007 => '/etc/xxx',
1008 => '/etc/xxx',
1009 => '/etc/xxx',
1014 => false,
),
If I do the installation without enforcing SSL for MySQL, and that I define REQUIRE SSL for SQL user and dbdriveroptions AFTER INSTALLATION , everything works fine.
Expected behaviour
It should connect to mySQL server using SSL options defined in config.php
Hello everyone,
The installation process fails directly when I enforce SSL for MySQL.
Steps to reproduce
CREATE USER ... REQUIRE SSLconfig.phpto tell the driver the certificates' locationUse occ to install
Actual behaviour
The installation fails with
and
occ maintenance:installmodifies theconfig.phpfile, turning this part:into
If I do the installation without enforcing SSL for MySQL, and that I define
REQUIRE SSLfor SQL user anddbdriveroptionsAFTER INSTALLATION , everything works fine.Expected behaviour
It should connect to mySQL server using SSL options defined in
config.php