-
-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
Bug Description
In asyncmy/connection.pyx, the _request_authentication method still references self.ssl in the sha256_password branch (line 825), but PR #102 renamed self.ssl to self._ssl_context everywhere else.
This causes an AttributeError when connecting to a MySQL-compatible database that uses sha256_password authentication plugin.
How to Reproduce
- Connect to a MySQL-compatible database (e.g. Huawei GaussDB) that uses
sha256_passwordas the default auth plugin - Do not use SSL (
ssl=None) - The connection fails with:
AttributeError: 'Connection' object has no attribute 'ssl'
Root Cause
PR #102 renamed self.ssl to self._ssl_context in __init__ and most of _request_authentication, but missed one reference in the sha256_password branch:
# connection.pyx line 825 (current, buggy)
if self.ssl and self.server_capabilities & SSL:Should be:
# fix
if self._ssl_context and self.server_capabilities & SSL:References
self._ssl_contextis used correctly at lines 229, 234, 778, 801- Only line 825 still uses the old
self.ssl - Introduced by PR Fix ssl handshake error with mysql server 8.0.34+ #102
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels