I’m developing a website using a Spring Boot restful API application and a MySQL database, both hosted on the same server. The API connects to the database using localhost. I’m exploring the best approach to set up the connection securely. Here are the options I’m considering:
- No TLS setup, relying solely on database password authentication.
- Password authentication with one-way TLS (which direction should it be?).
- Password authentication with two-way TLS (mutual TLS).
While I understand that mutual TLS is highly secure, I’m concerned about the encryption/decryption overhead, especially considering that the API and database are hosted on the same server.
Could you please provide insights into the most common and recommended approach in such a scenario? Any explanations or references to documentation would be greatly appreciated. Thank you!