mysqlclient 2.2.5 always uses SSL on Windows #742
Answered
by
mschoettle
mschoettle
asked this question in
Issue report
-
Describe the bugWith mysqlclient v2.2.5 connections on Windows to a database fail with the following error: Traceback (most recent call last):
File "<snip>.venv\Lib\site-packages\django\db\backends\base\base.py", line 289, in ensure_connection
self.connect()
File "<snip>.venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\django\db\backends\base\base.py", line 270, in connect
self.connection = self.get_new_connection(conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\django\db\backends\mysql\base.py", line 247, in get_new_connection
connection = Database.connect(**conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\MySQLdb\__init__.py", line 121, in Connect
return Connection(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\MySQLdb\connections.py", line 195, in __init__
super().__init__(*args, **kwargs2)
MySQLdb.OperationalError: (2026, 'TLS/SSL error: SSL is required, but the server does not support it')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "<snip>.venv\Lib\site-packages\django\db\models\query.py", line 374, in __repr__
data = list(self[: REPR_OUTPUT_SIZE + 1])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\django\db\models\query.py", line 398, in __iter__
self._fetch_all()
File "<snip>.venv\Lib\site-packages\django\db\models\query.py", line 1881, in _fetch_all
self._result_cache = list(self._iterable_class(self))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\django\db\models\query.py", line 91, in __iter__
results = compiler.execute_sql(
^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\django\db\models\sql\compiler.py", line 1560, in execute_sql
cursor = self.connection.cursor()
^^^^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\django\db\backends\base\base.py", line 330, in cursor
return self._cursor()
^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\django\db\backends\base\base.py", line 306, in _cursor
self.ensure_connection()
File "<snip>.venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\django\db\backends\base\base.py", line 288, in ensure_connection
with self.wrap_database_errors:
File "<snip>.venv\Lib\site-packages\django\db\utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "<snip>.venv\Lib\site-packages\django\db\backends\base\base.py", line 289, in ensure_connection
self.connect()
File "<snip>.venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\django\db\backends\base\base.py", line 270, in connect
self.connection = self.get_new_connection(conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\django\utils\asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\django\db\backends\mysql\base.py", line 247, in get_new_connection
connection = Database.connect(**conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\MySQLdb\__init__.py", line 121, in Connect
return Connection(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<snip>.venv\Lib\site-packages\MySQLdb\connections.py", line 195, in __init__
super().__init__(*args, **kwargs2)
django.db.utils.OperationalError: (2026, 'TLS/SSL error: SSL is required, but the server does not support it') Downgrading to v2.2.4 fixes this issue. According to this StackOverflow post it is due to the MariaDB C Connector: https://stackoverflow.com/questions/78984247/mariadb-update-causes-client-connection-problem-mariadb-operationalerror-tls Environment
How did you install libmysqlclient libraries?No response What version of mysqlclient do you use?2.2.5 Docker command to start MySQL serverNo response Minimum but complete code to reproduceNo response Schema and initial data required to reproduce.No response Commands, and any other step required to reproduce your issue.No response |
Beta Was this translation helpful? Give feedback.
Answered by
mschoettle
Nov 14, 2024
Replies: 1 comment 2 replies
-
The new version v2.2.6 fixes this issue. @methane Could you create a new release on GitHub to get the changelog? |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
mschoettle
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The new version v2.2.6 fixes this issue.
@methane Could you create a new release on GitHub to get the changelog?