-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
SSL handshake error with MySQL 8.0.34 #80
Comments
If anybody is experimenting this issue, switch to the aiomysql driver, it works with the following code:
|
It seems that this issue is more likely to be caused by inconsistent values of max_packet_size and character_set between asyncmy/asyncmy/connection.pyx Line 755 in 161b2dd
These values in client I'd like to open a Pull Request to fix it. @long2ice |
Small patch: Cycloctane@72d8e81 Tested with python 3.11 and mysql server 8.0.36 on debian bookworm. Patched version works well with tlsv1.2 enabled, while v0.2.9 causes bad handshake errors. import asyncio
import ssl
from sqlalchemy import text
from sqlalchemy.ext.asyncio import create_async_engine
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
ssl_context.load_cert_chain(certfile=..., keyfile=...)
async_engine = create_async_engine("mysql+asyncmy://...", connect_args={"ssl": ssl_context})
async def main():
async with async_engine.connect() as conn:
result = await conn.execute(text("SHOW DATABASES"))
print(result.all())
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main()) |
I'm experiencing an issue where
asyncmy
2.8.0 with Python 3.11 is generating an SSL Bad Handshake with MySQL 8.0.34. I'm not experiencing this issue withasyncmy
when connecting to MySQL 8.0.26. I'm also not experiencing this issue if I switch toaiomysql
and connect to MySQL 8.0.34.So it appears that the issue is specific to
asyncmy
2.8.0 and MySQL 8.0.34.Here is some example code I'm using to reproduce the issue:
which generates output when run against a connection to MySQL 8.0.34:
In case it's helpful, here are some outputs showing the differences in TLS versions between the MySQL 8.0.26 and MySQL 8.0.34 instances I'm using:
MySQL 8.0.26
MySQL 8.0.34
The text was updated successfully, but these errors were encountered: