Skip to content

Fix AttributeError on self.ssl in sha256_password auth branch#148

Open
shychee wants to merge 2 commits intolong2ice:devfrom
shychee:fix/sha256-password-ssl-attribute
Open

Fix AttributeError on self.ssl in sha256_password auth branch#148
shychee wants to merge 2 commits intolong2ice:devfrom
shychee:fix/sha256-password-ssl-attribute

Conversation

@shychee
Copy link
Copy Markdown

@shychee shychee commented Mar 24, 2026

Summary

  • Fix missed self.sslself._ssl_context rename in the sha256_password authentication branch of _request_authentication
  • PR Fix ssl handshake error with mysql server 8.0.34+ #102 renamed self.ssl to self._ssl_context everywhere except line 825, causing AttributeError when connecting to databases using sha256_password plugin
  • Update CHANGELOG

Change

- if self.ssl and self.server_capabilities & SSL:
+ if self._ssl_context and self.server_capabilities & SSL:

How to Reproduce

  1. Connect to a MySQL-compatible database (e.g. Huawei GaussDB) using sha256_password auth plugin
  2. Without SSL (ssl=None)
  3. Raises: AttributeError: 'Connection' object has no attribute 'ssl'

Fixes #147

shychee added 2 commits March 24, 2026 11:10
…sword branch

PR long2ice#102 renamed self.ssl to self._ssl_context but missed one reference
in the sha256_password authentication branch (line 825).

Fixes long2ice#147
@shychee
Copy link
Copy Markdown
Author

shychee commented Mar 24, 2026

@long2ice This is a one-line fix for a bug introduced by PR #102 — self.ssl was missed in the sha256_password branch.
Could you please take a look? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'Connection' object has no attribute 'ssl' in sha256_password auth branch

1 participant