Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does connection to my MySQL server in Azure fail if my app does not have SSL enabled?

I get a connection failure when I try to connect to my MySQL server in Azure from my app/client, which does not have SSL enabled. The error message is as follows:

SSL connection is required. Please specify SSL options and retry.

Is SSL mandatory when connecting to a MySQL server in Azure? Is there a way I can circumvent this requirement?

like image 948
Shantanu Avatar asked May 17 '17 22:05

Shantanu


2 Answers

By default, Azure Database for MySQL enforces SSL connections between your server and your client applications to protect against MITM (man in the middle) attacks. This is done to make the connection to your server as secure as possible.

Although not recommended, you have the option to disable requiring SSL for connecting to your server if your client application does not support SSL connectivity. Please check How to Configure SSL Connectivity for your MySQL server in Azure for more details. You can disable requiring SSL connections from either the portal or using CLI. Note that Azure does not recommend disabling requiring SSL connections when connecting to your server.

like image 135
Shantanu Avatar answered Nov 08 '22 08:11

Shantanu


Option 1 In Azure portal under"Azure Database for MySQL servers"

  1. Choose the MySql server
  2. Go to Server parameters -> Select require_secure_transport parameter and update value to OFF -> save

Option 2

  1. Download the certifccate from https://www.digicert.com/CACerts/BaltimoreCyberTrustRoot.crt.pem

  2. Connect to MySql server with these certificate

    mysql -h mydemoserver.mysql.database.azure.com -u Username@mydemoserver -p --ssl-ca=/opt/ssl/BaltimoreCyberTrustRoot.crt.pem

like image 12
Joice Joseph Avatar answered Nov 08 '22 08:11

Joice Joseph