Welcome Guest, Not a member yet? Register   Sign In
mysqli with SSL via .env file settings

(This post was last modified: 01-28-2021, 04:13 PM by evansharp.)


After reading the relevant docs, I am still having difficulty getting CI to connect to my mysql database with SSL enabled. Does this have to do with my .env formatting?

database.default.hostname = localhost <socket connection and loopback both work in shell, I've tried both here>
database.default.database = <dbname>
database.default.username = <uname, verified by shell login>
database.default.password = <password, verified by shell login>
database.default.DBDriver = MySQLi

database.default.encrypt.ssl_key = '<absolute system path>/client-key.pem'
database.default.encrypt.ssl_cert = '<absolute system path>/client-cert.pem'
database.default.encrypt.ssl_ca = '<absolute system path>/ca-cert.pem'
database.default.encrypt.ssl_verify = FALSE

I've set ownership on the cert files to myuser:apacheuser and the permissions to 440. These are the same cert files I have downloaded and used successfully connecting to this server with Sequel Pro.

What am I missing?

(This post was last modified: 01-29-2021, 10:14 AM by evansharp.)

I got it. Posting for others:

1) Paths to cert files in `.env` do not need quotes! They're not parsed correctly with quotes, removing them allowed the values to be stored.
2) Increasing my logging threshold to '8' in /App/Config/Logger.php revealed that the mysqli driver was not loading. This led me to discover that when I bumped to php7.4 on this box, php7.4-mysql hadn't been configured correctly. A quick `dpkg -configure` sorted it out.

Theme © iAndrew 2016 - Forum software by © MyBB