Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ssl handshake error with mysql server 8.0.34+ #102

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Fix ssl context pass bool.
- Fix missing `*.whl` for Python 3.12 (#94)
- Fix SSL handshake error with MySQL server v8.0.34+. (#80)

### 0.2.9

Expand Down
4 changes: 2 additions & 2 deletions asyncmy/connection.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,10 @@ class Connection:
if self._user is None:
raise ValueError("Did not specify a username")

charset_id = charset_by_name(self._charset).id
if self._ssl_context:
# capablities, max packet, charset
data = IIB.pack(self._client_flag, 16777216, 33)
data = IIB.pack(self._client_flag, MAX_PACKET_LEN, charset_id)
data += b'\x00' * (32 - len(data))

self.write_packet(data)
Expand All @@ -776,7 +777,6 @@ class Connection:
sock=raw_sock, ssl=self._ssl_context,
server_hostname=self._host,
)
charset_id = charset_by_name(self._charset).id
if isinstance(self._user, str):
self._user = self._user.encode(self._encoding)

Expand Down