Skip to content

Commit 09bea07

Browse files
authored
Merge pull request #102 from Cycloctane/dev
2 parents 7c66b1b + 3b863dc commit 09bea07

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

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

1011
### 0.2.9
1112

asyncmy/connection.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -750,9 +750,10 @@ class Connection:
750750
if self._user is None:
751751
raise ValueError("Did not specify a username")
752752

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

758759
self.write_packet(data)
@@ -776,7 +777,6 @@ class Connection:
776777
sock=raw_sock, ssl=self._ssl_context,
777778
server_hostname=self._host,
778779
)
779-
charset_id = charset_by_name(self._charset).id
780780
if isinstance(self._user, str):
781781
self._user = self._user.encode(self._encoding)
782782

0 commit comments

Comments
 (0)