title: MysqlOperator in airflow 2.0.1 failed with "ssl connection error"
body: <p>I am new to airflow and I am trying to test Mysql connection using MysqlOperator in airflow 2.0.1. However I am getting an error regarding to <strong>ssl connection error</strong>. I have tried to add extra parameters to disable ssl mode, but still I am getting the same error.</p>
  <p>Here is my code, (I tried to pass the <strong>ssl param = disable</strong> in the code), and it doesn't work.</p>
  <pre><code>from airflow import DAG
  from airflow.providers.mysql.operators.mysql import MySqlOperator
  from airflow.operators.python import PythonOperator
  from airflow.operators.dummy_operator import DummyOperator
  
  from airflow.utils.dates import days_ago, timedelta
  
  default_args = {
      'owner' : 'airflow',
      'depend_on_past' : False,
      'start_date' : days_ago(2),
      'retries' : 1,
      'retry_delay' : timedelta(minutes=1)
  }
  
  with DAG(
      'mysqlConnTest',
      default_args=default_args,
      schedule_interval='@once',
      catchup=False) as dag:
  
      
      start_date = DummyOperator(task_id = &quot;start_task&quot;)
     
      
      # [START howto_operator_mysql]
      select_table_mysql_task = MySqlOperator(
          task_id='select_table_mysql', mysql_conn_id='mysql', sql=&quot;SELECT * FROM country;&quot;autocommit=True, parameters= {'ssl_mode': 'DISABLED'}
      )
  
  
  
      start_date &gt;&gt; select_table_mysql_task
  </code></pre>
  <p>and here is the error</p>
  <pre><code>*** Reading local file: /opt/airflow/logs/mysqlHookConnTest/select_table_mysql/2021-04-14T12:46:42.221662+00:00/2.log
  [2021-04-14 12:47:46,791] {taskinstance.py:851} INFO - Dependencies all met for &lt;TaskInstance: mysqlHookConnTest.select_table_mysql 2021-04-14T12:46:42.221662+00:00 [queued]&gt;
  [2021-04-14 12:47:47,007] {taskinstance.py:851} INFO - Dependencies all met for &lt;TaskInstance: mysqlHookConnTest.select_table_mysql 2021-04-14T12:46:42.221662+00:00 [queued]&gt;
  [2021-04-14 12:47:47,047] {taskinstance.py:1042} INFO - 
  --------------------------------------------------------------------------------
  [2021-04-14 12:47:47,054] {taskinstance.py:1043} INFO - Starting attempt 2 of 2
  [2021-04-14 12:47:47,074] {taskinstance.py:1044} INFO - 
  --------------------------------------------------------------------------------
  [2021-04-14 12:47:47,331] {taskinstance.py:1063} INFO - Executing &lt;Task(MySqlOperator): select_table_mysql&gt; on 2021-04-14T12:46:42.221662+00:00
  [2021-04-14 12:47:47,377] {standard_task_runner.py:52} INFO - Started process 66 to run task
  [2021-04-14 12:47:47,402] {standard_task_runner.py:76} INFO - Running: ['airflow', 'tasks', 'run', 'mysqlHookConnTest', 'select_table_mysql', '2021-04-14T12:46:42.221662+00:00', '--job-id', '142', '--pool', 'default_pool', '--raw', '--subdir', 'DAGS_FOLDER/MySqlHookConnTest.py', '--cfg-path', '/tmp/tmppujnrey3', '--error-file', '/tmp/tmpjl_g_p3t']
  [2021-04-14 12:47:47,413] {standard_task_runner.py:77} INFO - Job 142: Subtask select_table_mysql
  [2021-04-14 12:47:47,556] {logging_mixin.py:104} INFO - Running &lt;TaskInstance: mysqlHookConnTest.select_table_mysql 2021-04-14T12:46:42.221662+00:00 [running]&gt; on host ea95b9685a31
  [2021-04-14 12:47:47,672] {taskinstance.py:1257} INFO - Exporting the following env vars:
  AIRFLOW_CTX_DAG_OWNER=airflow
  AIRFLOW_CTX_DAG_ID=mysqlHookConnTest
  AIRFLOW_CTX_TASK_ID=select_table_mysql
  AIRFLOW_CTX_EXECUTION_DATE=2021-04-14T12:46:42.221662+00:00
  AIRFLOW_CTX_DAG_RUN_ID=manual__2021-04-14T12:46:42.221662+00:00
  [2021-04-14 12:47:47,687] {mysql.py:72} INFO - Executing: SELECT idPais, Nombre, codigo, paisPlataforma, create_date, update_date FROM ob_cpanel.cpanel_pais;
  [2021-04-14 12:47:47,710] {base.py:74} INFO - Using connection to: id: mysql. Host: sys-sql-pre-01.oneboxtickets.net, Port: 3306, Schema: , Login: lectura, Password: None, extra: None
  [2021-04-14 12:47:48,134] {taskinstance.py:1455} ERROR - (2006, 'SSL connection error: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol')
  Traceback (most recent call last):
    File &quot;/home/airflow/.local/lib/python3.6/site-packages/airflow/models/taskinstance.py&quot;, line 1112, in _run_raw_task
      self._prepare_and_execute_task_with_callbacks(context, task)
    File &quot;/home/airflow/.local/lib/python3.6/site-packages/airflow/models/taskinstance.py&quot;, line 1285, in _prepare_and_execute_task_with_callbacks
      result = self._execute_task(context, task_copy)
    File &quot;/home/airflow/.local/lib/python3.6/site-packages/airflow/models/taskinstance.py&quot;, line 1315, in _execute_task
      result = task_copy.execute(context=context)
    File &quot;/home/airflow/.local/lib/python3.6/site-packages/airflow/providers/mysql/operators/mysql.py&quot;, line 74, in execute
      hook.run(self.sql, autocommit=self.autocommit, parameters=self.parameters)
    File &quot;/home/airflow/.local/lib/python3.6/site-packages/airflow/hooks/dbapi.py&quot;, line 173, in run
      with closing(self.get_conn()) as conn:
    File &quot;/home/airflow/.local/lib/python3.6/site-packages/airflow/providers/mysql/hooks/mysql.py&quot;, line 144, in get_conn
      return MySQLdb.connect(**conn_config)
    File &quot;/home/airflow/.local/lib/python3.6/site-packages/MySQLdb/__init__.py&quot;, line 85, in Connect
      return Connection(*args, **kwargs)
    File &quot;/home/airflow/.local/lib/python3.6/site-packages/MySQLdb/connections.py&quot;, line 208, in __init__
      super(Connection, self).__init__(*args, **kwargs2)
  _mysql_exceptions.OperationalError: (2006, 'SSL connection error: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol')
  [2021-04-14 12:47:48,143] {taskinstance.py:1503} INFO - Marking task as FAILED. dag_id=mysqlHookConnTest, task_id=select_table_mysql, execution_date=20210414T124642, start_date=20210414T124746, end_date=20210414T124748
  [2021-04-14 12:47:48,243] {local_task_job.py:146} INFO - Task exited with return code 1
  </code></pre>
  <p>We have tried to remove the last two parameter from the dag code, and we add in extra field(conn-airflow UI). Adding this json</p>
  <blockquote>
  <p>{&quot;ssl&quot;:false}</p>
  </blockquote>
  <p>and the issue appears with another similar error</p>
  <pre><code>/opt/airflow/logs/mysqlOperatorConnTest/select_table_mysql/2021-04-15T11:26:50.578333+00:00/2.log
  *** Fetching from: http://airflow-worker-0.airflow-worker.airflow.svc.cluster.local:8793/log/mysqlOperatorConnTest/select_table_mysql/2021-04-15T11:26:50.578333+00:00/2.log
  [2021-04-15 11:27:54,471] {taskinstance.py:851} INFO - Dependencies all met for &lt;TaskInstance: mysqlOperatorConnTest.select_table_mysql 2021-04-15T11:26:50.578333+00:00 [queued]&gt;
  [2021-04-15 11:27:54,497] {taskinstance.py:851} INFO - Dependencies all met for &lt;TaskInstance: mysqlOperatorConnTest.select_table_mysql 2021-04-15T11:26:50.578333+00:00 [queued]&gt;
  [2021-04-15 11:27:54,497] {taskinstance.py:1042} INFO - 
  --------------------------------------------------------------------------------
  [2021-04-15 11:27:54,497] {taskinstance.py:1043} INFO - Starting attempt 2 of 2
  [2021-04-15 11:27:54,497] {taskinstance.py:1044} INFO - 
  --------------------------------------------------------------------------------
  [2021-04-15 11:27:54,507] {taskinstance.py:1063} INFO - Executing &lt;Task(MySqlOperator): select_table_mysql&gt; on 2021-04-15T11:26:50.578333+00:00
  [2021-04-15 11:27:54,510] {standard_task_runner.py:52} INFO - Started process 115 to run task
  [2021-04-15 11:27:54,514] {standard_task_runner.py:76} INFO - Running: ['airflow', 'tasks', 'run', 'mysqlOperatorConnTest', 'select_table_mysql', '2021-04-15T11:26:50.578333+00:00', '--job-id', '68', '--pool', 'default_pool', '--raw', '--subdir', '/opt/airflow/dags/repo/MySqlOperatorConnTest.py', '--cfg-path', '/tmp/tmpy7bv58_z', '--error-file', '/tmp/tmpaoe808of']
  [2021-04-15 11:27:54,514] {standard_task_runner.py:77} INFO - Job 68: Subtask select_table_mysql
  [2021-04-15 11:27:54,644] {logging_mixin.py:104} INFO - Running &lt;TaskInstance: mysqlOperatorConnTest.select_table_mysql 2021-04-15T11:26:50.578333+00:00 [running]&gt; on host airflow-worker-0.airflow-worker.airflow.svc.cluster.local
  [2021-04-15 11:27:54,707] {logging_mixin.py:104} WARNING - /opt/python/site-packages/sqlalchemy/sql/coercions.py:518 SAWarning: Coercing Subquery object into a select() for use in IN(); please pass a select() construct explicitly
  [2021-04-15 11:27:54,725] {taskinstance.py:1255} INFO - Exporting the following env vars:
  AIRFLOW_CTX_DAG_OWNER=airflow
  AIRFLOW_CTX_DAG_ID=mysqlOperatorConnTest
  AIRFLOW_CTX_TASK_ID=select_table_mysql
  AIRFLOW_CTX_EXECUTION_DATE=2021-04-15T11:26:50.578333+00:00
  AIRFLOW_CTX_DAG_RUN_ID=manual__2021-04-15T11:26:50.578333+00:00
  [2021-04-15 11:27:54,726] {mysql.py:72} INFO - Executing: SELECT idPais, Nombre, codigo, paisPlataforma, create_date, update_date FROM ob_cpanel.cpanel_pais;
  [2021-04-15 11:27:54,744] {connection.py:337} ERROR - Expecting value: line 2 column 9 (char 11)
  Traceback (most recent call last):
    File &quot;/opt/python/site-packages/airflow/models/connection.py&quot;, line 335, in extra_dejson
      obj = json.loads(self.extra)
    File &quot;/usr/local/lib/python3.8/json/__init__.py&quot;, line 357, in loads
      return _default_decoder.decode(s)
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 337, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 355, in raw_decode
      raise JSONDecodeError(&quot;Expecting value&quot;, s, err.value) from None
  json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 11)
  [2021-04-15 11:27:54,744] {connection.py:338} ERROR - Failed parsing the json for conn_id mysql
  [2021-04-15 11:27:54,744] {base.py:65} INFO - Using connection to: id: mysql. Host: sys-sql-pre-01.oneboxtickets.net, Port: 3306, Schema: , Login: lectura, Password: XXXXXXXX, extra: None
  [2021-04-15 11:27:54,745] {connection.py:337} ERROR - Expecting value: line 2 column 9 (char 11)
  Traceback (most recent call last):
    File &quot;/opt/python/site-packages/airflow/models/connection.py&quot;, line 335, in extra_dejson
      obj = json.loads(self.extra)
    File &quot;/usr/local/lib/python3.8/json/__init__.py&quot;, line 357, in loads
      return _default_decoder.decode(s)
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 337, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 355, in raw_decode
      raise JSONDecodeError(&quot;Expecting value&quot;, s, err.value) from None
  json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 11)
  [2021-04-15 11:27:54,745] {connection.py:338} ERROR - Failed parsing the json for conn_id mysql
  [2021-04-15 11:27:54,745] {connection.py:337} ERROR - Expecting value: line 2 column 9 (char 11)
  Traceback (most recent call last):
    File &quot;/opt/python/site-packages/airflow/models/connection.py&quot;, line 335, in extra_dejson
      obj = json.loads(self.extra)
    File &quot;/usr/local/lib/python3.8/json/__init__.py&quot;, line 357, in loads
      return _default_decoder.decode(s)
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 337, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 355, in raw_decode
      raise JSONDecodeError(&quot;Expecting value&quot;, s, err.value) from None
  json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 11)
  [2021-04-15 11:27:54,745] {connection.py:338} ERROR - Failed parsing the json for conn_id mysql
  [2021-04-15 11:27:54,746] {connection.py:337} ERROR - Expecting value: line 2 column 9 (char 11)
  Traceback (most recent call last):
    File &quot;/opt/python/site-packages/airflow/models/connection.py&quot;, line 335, in extra_dejson
      obj = json.loads(self.extra)
    File &quot;/usr/local/lib/python3.8/json/__init__.py&quot;, line 357, in loads
      return _default_decoder.decode(s)
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 337, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 355, in raw_decode
      raise JSONDecodeError(&quot;Expecting value&quot;, s, err.value) from None
  json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 11)
  [2021-04-15 11:27:54,746] {connection.py:338} ERROR - Failed parsing the json for conn_id mysql
  [2021-04-15 11:27:54,746] {connection.py:337} ERROR - Expecting value: line 2 column 9 (char 11)
  Traceback (most recent call last):
    File &quot;/opt/python/site-packages/airflow/models/connection.py&quot;, line 335, in extra_dejson
      obj = json.loads(self.extra)
    File &quot;/usr/local/lib/python3.8/json/__init__.py&quot;, line 357, in loads
      return _default_decoder.decode(s)
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 337, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 355, in raw_decode
      raise JSONDecodeError(&quot;Expecting value&quot;, s, err.value) from None
  json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 11)
  [2021-04-15 11:27:54,746] {connection.py:338} ERROR - Failed parsing the json for conn_id mysql
  [2021-04-15 11:27:54,746] {connection.py:337} ERROR - Expecting value: line 2 column 9 (char 11)
  Traceback (most recent call last):
    File &quot;/opt/python/site-packages/airflow/models/connection.py&quot;, line 335, in extra_dejson
      obj = json.loads(self.extra)
    File &quot;/usr/local/lib/python3.8/json/__init__.py&quot;, line 357, in loads
      return _default_decoder.decode(s)
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 337, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 355, in raw_decode
      raise JSONDecodeError(&quot;Expecting value&quot;, s, err.value) from None
  json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 11)
  [2021-04-15 11:27:54,747] {connection.py:338} ERROR - Failed parsing the json for conn_id mysql
  [2021-04-15 11:27:54,747] {connection.py:337} ERROR - Expecting value: line 2 column 9 (char 11)
  Traceback (most recent call last):
    File &quot;/opt/python/site-packages/airflow/models/connection.py&quot;, line 335, in extra_dejson
      obj = json.loads(self.extra)
    File &quot;/usr/local/lib/python3.8/json/__init__.py&quot;, line 357, in loads
      return _default_decoder.decode(s)
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 337, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 355, in raw_decode
      raise JSONDecodeError(&quot;Expecting value&quot;, s, err.value) from None
  json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 11)
  [2021-04-15 11:27:54,747] {connection.py:338} ERROR - Failed parsing the json for conn_id mysql
  [2021-04-15 11:27:54,747] {connection.py:337} ERROR - Expecting value: line 2 column 9 (char 11)
  Traceback (most recent call last):
    File &quot;/opt/python/site-packages/airflow/models/connection.py&quot;, line 335, in extra_dejson
      obj = json.loads(self.extra)
    File &quot;/usr/local/lib/python3.8/json/__init__.py&quot;, line 357, in loads
      return _default_decoder.decode(s)
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 337, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File &quot;/usr/local/lib/python3.8/json/decoder.py&quot;, line 355, in raw_decode
      raise JSONDecodeError(&quot;Expecting value&quot;, s, err.value) from None
  json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 11)
  [2021-04-15 11:27:54,747] {connection.py:338} ERROR - Failed parsing the json for conn_id mysql
  [2021-04-15 11:27:54,787] {taskinstance.py:1455} ERROR - (2006, 'SSL connection error: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol')
  Traceback (most recent call last):
    File &quot;/opt/python/site-packages/airflow/models/taskinstance.py&quot;, line 1112, in _run_raw_task
      self._prepare_and_execute_task_with_callbacks(context, task)
    File &quot;/opt/python/site-packages/airflow/models/taskinstance.py&quot;, line 1285, in _prepare_and_execute_task_with_callbacks
      result = self._execute_task(context, task_copy)
    File &quot;/opt/python/site-packages/airflow/models/taskinstance.py&quot;, line 1315, in _execute_task
      result = task_copy.execute(context=context)
    File &quot;/home/airflow/.local/lib/python3.8/site-packages/airflow/providers/mysql/operators/mysql.py&quot;, line 74, in execute
      hook.run(self.sql, autocommit=self.autocommit, parameters=self.parameters)
    File &quot;/opt/python/site-packages/airflow/hooks/dbapi.py&quot;, line 173, in run
      with closing(self.get_conn()) as conn:
    File &quot;/home/airflow/.local/lib/python3.8/site-packages/airflow/providers/mysql/hooks/mysql.py&quot;, line 144, in get_conn
      return MySQLdb.connect(**conn_config)
    File &quot;/home/airflow/.local/lib/python3.8/site-packages/MySQLdb/__init__.py&quot;, line 85, in Connect
      return Connection(*args, **kwargs)
    File &quot;/home/airflow/.local/lib/python3.8/site-packages/MySQLdb/connections.py&quot;, line 208, in __init__
      super(Connection, self).__init__(*args, **kwargs2)
  _mysql_exceptions.OperationalError: (2006, 'SSL connection error: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol')
  [2021-04-15 11:27:54,788] {taskinstance.py:1496} INFO - Marking task as FAILED. dag_id=mysqlOperatorConnTest, task_id=select_table_mysql, execution_date=20210415T112650, start_date=20210415T112754, end_date=20210415T112754
  [2021-04-15 11:27:54,845] {local_task_job.py:146} INFO - Task exited with return code 1
  </code></pre>