From 2dfb698dd66bfd339b09f5be9da324a824297be2 Mon Sep 17 00:00:00 2001 From: shychee Date: Tue, 24 Mar 2026 11:10:55 +0800 Subject: [PATCH 1/2] Fix AttributeError: 'Connection' has no attribute 'ssl' in sha256_password branch PR #102 renamed self.ssl to self._ssl_context but missed one reference in the sha256_password authentication branch (line 825). Fixes #147 --- asyncmy/connection.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asyncmy/connection.pyx b/asyncmy/connection.pyx index a3bf521..eaeb2c3 100644 --- a/asyncmy/connection.pyx +++ b/asyncmy/connection.pyx @@ -822,7 +822,7 @@ class Connection: authresp = auth.scramble_caching_sha2(self._password, self.salt) elif self._auth_plugin_name == "sha256_password": plugin_name = b"sha256_password" - if self.ssl and self.server_capabilities & SSL: + if self._ssl_context and self.server_capabilities & SSL: authresp = self._password + b"\0" elif self._password: authresp = b"\1" # request public key From e4da122048ae67f76372630d1e9018a63003584b Mon Sep 17 00:00:00 2001 From: shychee Date: Tue, 24 Mar 2026 11:13:35 +0800 Subject: [PATCH 2/2] Update CHANGELOG for sha256_password ssl attribute fix (#147) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d86b6a..4a953f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### 0.2.12 - Performence improvement, details see [benchmark/README.md](benchmark/README.md). +- Fix `AttributeError: 'Connection' object has no attribute 'ssl'` in `sha256_password` auth branch. (#147) ### 0.2.11