php - Submit Form Data through Web Server to MySQL Server using Stunnel? -
I have a form that users can fill, and the data will be stored in a MySQL database using PHP . The connection to the Apache server is encrypted with HTTPS, and I want to encrypt the connection to MySQL database. Both Apache and MySQL are on the same server machine.
I dug around the interwab and I think what I need is what I need. OpenSSL and SSL are supported and active on the server, because we have been given the option of using standard ports and stanel ports to connect to the MySQL server. However, all the articles I found online deal with using a stainless steel to connect a MySQL client to an external MySQL server, but PHP was not used to connect to a local MySQL server. Do I have the right to believe that just because the form is transmitted via https, does not it mean that the connection to the database is also encrypted?
This works fine using standardport though, if I change it to a stern port, then I get a connection time-out error. I'm obviously missing something ; Any help and advice is appreciated! Thanks! You have already said that you use HTTPS connection to encrypt traffic between the client browser Your webservers and webservers and MySQL examples are on the same machine. It is safe to pat the HTTPS connection, you need to protect your data on the public network, and use a secure tunnel. A connection that exists only on the local machine, just adds an unnecessary layer of complexity. Consider the following examples. So in this scenario, the connection between the webserver and mysql is unencrypted, to inspect all the traffic between a server (based on permissions) and the server using the machine / Or the physical database from the disk itself. I hope you can see that the connection between the webserver and a secure tunnel endpoint, and connections between mysql and other endpoint are both encrypted in this scenario, In the same way, a person with access to the machine can possibly see all the traffic and read the database from the disk. No additional security is achieved. When you are using two different servers, the local traffic is still unencrypted, although the stanel is between the two machines on the Between stream Protects anyone with the local access to the machines and can read the data, however there will be no one to see the network traffic between the servers. All this said, if you really want to encrypt the traffic between PHP and MySQL on the same machine, then a slightly better solution exists before using the stunnel. MySQL basically supports SSL, as PHP does when both compile with SSL support provide MySQL manual details and PHP function By using this combination, you can basically encrypt the connection between PHP and mysql servers. However Anyone with access to the machine can still read the Unencrypted database from the disk, and may be able to run To memorize the processes. You are absolutely right, the internet is a dangerous place, and proper security is necessary. If your server is included in the data, then it is not safe, everything is lost, there is nothing that you take precautions about how the data enters and leaves it.
The first method is to see how the connection without a secure tunnel Browser & lt; - HTTPS - & gt; [Webserver & lt; - & gt; Mysql]
Now, with a secure tunnel [webserver & lt; - & gt; Stunnel & lt; - Encrypted - & gt; Stunnel & lt; - & gt; MySQL]
Finally [webserver & lt; - & gt; Stunnel] & lt; - Encrypted - & gt; [Stunnel & lieutenant; - & gt; Mysql]
A solution?
[webserver & lt; - encryption - & gt; Mysql]
Comments
Post a Comment