CodeIgniter Forums
Secure transport for remote database connection - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Secure transport for remote database connection (/showthread.php?tid=77193)



Secure transport for remote database connection - aforica - 07-30-2020

Hi Everyone,

I'm trying to connect my CodeIgniter app to a remote database and from the database side I have the following:

require_secure_transport = on




So I therefore would like to be advise how to tell my app to connect the remote database using secure transport.

Currently I get the following error:

Error: Unable to connect to MySQL.
Debugging errno: 3159
Debugging error: Connections using insecure transport are prohibited while --require_secure_transport=ON.

I tried to modify the config/database.php file but was not sure what to change or add.

Your help will be highly appreciated


RE: Secure transport for remote database connection - php_rocs - 07-30-2020

@aforica,

What version of CI are you using? Can you show us your db configuration code (without revealing any links and passwords)?


RE: Secure transport for remote database connection - aforica - 07-30-2020

@php_rocs,

As you requested here are the info below:

CI version - 3.1.11

Database snapshot - https://filedn.com/lL8lDt3x0NmXCyz0AN5ttCR/snapshot.png


RE: Secure transport for remote database connection - aforica - 07-30-2020

So at the moment, in order for me to connect I had to disable this: (require_secure_transport = on) from the db server and the connection was successful but I will be turning it on again as soon as I get help.


RE: Secure transport for remote database connection - mmraja83 - 02-25-2021

(07-30-2020, 02:25 PM)aforica Wrote: So at the moment, in order for me to connect I had to disable this: (require_secure_transport = on) from the db server and the connection was successful but I will be turning it on again as soon as I get help.
Hi Everyone,

Is there any update on this?

Thanks,
Raja.


RE: Secure transport for remote database connection - InsiteFX - 02-25-2021

You need to read this.

5.1 Configuring MySQL to Use Encrypted Connections


RE: Secure transport for remote database connection - Labbielsen - 01-08-2023

Hi,
Thank you for your question. In order to connect to a remote database using secure transport, you will need to set the connection URL in your code to use HTTPS instead of HTTP. For example, if your database is hosted at 'example.com', you would use the following URL:
mysql://username:[email protected]/database_name
Please let us know if you have any other questions.