Skip to content

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

Open
shychee wants to merge 2 commits into
long2ice: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 into
long2ice: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
  • The sha256_password authentication branch in _request_authentication still referenced the old self.ssl instead of self._ssl_context, causing AttributeError when connecting without SSL
  • 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
Copy link
Copy Markdown
Author

shychee commented Mar 24, 2026

@long2ice This is a one-line fix — self.ssl was missed in the sha256_password branch and should be self._ssl_context.
Could you please take a look? Thanks!

@shychee shychee force-pushed the fix/sha256-password-ssl-attribute branch from e4da122 to 425e486 Compare April 28, 2026 03:37
shychee added 2 commits April 28, 2026 11:52
…sword branch

The sha256_password authentication branch in _request_authentication
still referenced the old self.ssl instead of self._ssl_context,
causing AttributeError when connecting without SSL.

Fixes long2ice#147
@shychee shychee force-pushed the fix/sha256-password-ssl-attribute branch from 425e486 to 1555470 Compare April 28, 2026 03:52
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