Welcome Guest, Not a member yet? Register   Sign In
Connection to db with certificate
#2
Exclamation 
(This post was last modified: 03-15-2021, 07:14 AM by yuma2020.)

(03-12-2021, 01:01 AM)nilo Wrote: Hi everyone,
I developed an application with CI4 in local environment based on MariaDB, now I need to move the application to testing environment and here the connection to DB is supported with certificate.

I use .env file for the config and this is my config 
Code:
database.default.hostname = localhost
database.default.database = databasename
database.default.username = databaseuser
database.default.password = dataabasepassword
database.default.DBDriver = MySQLi
database.default.charset  = utf8
database.default.DBCollat  = utf8_general_ci
database.default.port  = 3306

database.default.encrypt  = TRUE
database.default.encrypt.ssl_key  = /etc/mysql/newcerts/CLIENT/client-key.pem
database.default.encrypt.ssl_cert = /etc/mysql/newcerts/CLIENT/client-cert.pem
database.default.encrypt.ssl_ca  = /etc/mysql/newcerts/CLIENT/ca-cert.pem
#database.default.encrypt.ssl_capath  = /etc/mysql/newcerts/CLIENT/
#database.default.encrypt.ssl_cipher  = DHE-RSA-AES256-SHA
database.default.encrypt.ssl_verify = FALSE

The problem is:"SYSTEMPATH/Database/BaseConnection.php at line 395"
throw new DatabaseException('Unable to connect to the database.');

In the same environment works java application that use the connection with certificate 
Can someone help me?

Thanks for the support!
Hello, technically you must first try from simple php if the certificates work correctly and communication with the database, after doing the above only said there you have to check if everything is properly typed from the absolute locations in linux (recommended), once you have done all of the above you should check the status, the php version and if the php-mysql functions are actually installed according to the version that applies , a gallbladder all this should test everything and theorically if the server is well configured (environment) and the locations of the files and the so is linux you should not have problems connecting it.

But to solve you must do tests and you will need to test before taking out anticipated conspiracy conjectures.

You must think that is what you want to do and how you want to do it, all environments are different, because you have not explained to us if we are talking about an environment in local, test, production, we also do not know if it is linux or windows, you should also add an info.php, I think it is too redundant the request for help with data as basic as a configuration because all the environments are of different complexity and more if you are only a programmer and you do not have of technical knowledge of systems, but remember that there are good environments to try locally such as laragon, xampp or lamp you can also consider that you can try it in cpanel hosting and different means available or also do not know if you have Linux knowledge in production to help you or guide you how to solve the matter.
Reply


Messages In This Thread
Connection to db with certificate - by nilo - 03-12-2021, 01:01 AM
RE: Connection to db with certificate - by yuma2020 - 03-15-2021, 07:07 AM
RE: Connection to db with certificate - by nilo - 03-15-2021, 12:54 PM
RE: Connection to db with certificate - by nilo - 03-15-2021, 01:58 PM
RE: Connection to db with certificate - by kenjis - 03-17-2021, 05:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB