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

AttributeError raised if set ssl with boolean #90

Open
simonsmh opened this issue Mar 3, 2024 · 2 comments
Open

AttributeError raised if set ssl with boolean #90

simonsmh opened this issue Mar 3, 2024 · 2 comments

Comments

@simonsmh
Copy link

simonsmh commented Mar 3, 2024

I'm using tortoise-orm with asyncmy, with DB_URL and with ssl parameter with docs like this.

await Tortoise.init(
        db_url="mysql://user:pswd@host/db?ssl=True",
        use_tz=True,
    )

When I switching from aiomysql to asyncmy, the error occurs.

  File "/***/tortoise/backends/mysql/client.py", line 114, in create_connection
    self._pool = await mysql.create_pool(password=self.password, **self._template)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "asyncmy/pool.pyx", line 216, in _create_pool
  File "asyncmy/pool.pyx", line 217, in asyncmy.pool._create_pool
  File "asyncmy/pool.pyx", line 145, in fill_free_pool
  File "asyncmy/connection.pyx", line 1340, in _connect
  File "asyncmy/connection.pyx", line 232, in asyncmy.connection.Connection.__init__
  File "asyncmy/connection.pyx", line 303, in asyncmy.connection.Connection._create_ssl_ctx
AttributeError: 'bool' object has no attribute 'get'

I think there should be a default setting if the ssl param is not a dict instance. Everything works on aiomysql btw.

@long2ice
Copy link
Owner

What version?

@simonsmh
Copy link
Author

tested with asyncmy v0.2.9

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

No branches or pull requests

2 participants