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

aiomysql does not support TLS on Python 3.8 on Windows #589

Open
huwcbjones opened this issue Jun 4, 2021 · 0 comments
Open

aiomysql does not support TLS on Python 3.8 on Windows #589

huwcbjones opened this issue Jun 4, 2021 · 0 comments

Comments

@huwcbjones
Copy link

Due to the Python 3.8 changing the default event loop to proactor, start_tls does not work, therefore you cannot connect to a server using TLS.

As per tornadoweb/tornado#2608 and aio-libs/aiohttp#4536, this limitation should probably be documented somewhere.

The solution, change the event loop policy before the event loop is created.

async def main():
    # Do stuff
    pass


if __name__ == "__main__":
    policy = asyncio.WindowsSelectorEventLoopPolicy()
    asyncio.set_event_loop_policy(policy)
    asyncio.run(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants