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

Support non-standard implicit TLS connections, such as Google Cloud SQL #786

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Nothing4You
Copy link
Collaborator

@Nothing4You Nothing4You commented May 8, 2022

What do these changes do?

This adds a new implicit_tls argument when creating connections.
When this argument is given, the initial non-TLS preamble is skipped and the connection will be upgraded to TLS immediately.

Are there changes in behavior for the user?

No change in default behavior.

Related issue number

fixes #757

Checklist

  • Add explicit non-TLS test case if we don't already have one to prevent regressions on non-TLS connections
  • Add test for implicit TLS
    • add HAproxy service container, terminating TLS
    • add implicit TLS test set to pytest, e.g. --mysql-tls-address to generate an extra set of tests in the matrix.
      this will run all tests on an implicit-TLS-connection when provided.
  • Documentation reflects the changes
  • Add a new news fragment into CHANGES.txt

Once everything else has been done

  • Review entire change again
  • Get review from someone else

@Nothing4You Nothing4You added this to the 0.2 milestone May 8, 2022
@codecov
Copy link

codecov bot commented May 8, 2022

Codecov Report

Merging #786 (6dd7caa) into master (780420b) will decrease coverage by 1.13%.
The diff coverage is 50.00%.

❗ Current head 6dd7caa differs from pull request most recent head 8793725. Consider uploading reports for the commit 8793725 to get more accurate results

@@            Coverage Diff             @@
##           master     #786      +/-   ##
==========================================
- Coverage   93.66%   92.52%   -1.14%     
==========================================
  Files          36       38       +2     
  Lines        5507     5565      +58     
  Branches      931      944      +13     
==========================================
- Hits         5158     5149       -9     
- Misses        262      325      +63     
- Partials       87       91       +4     
Flag Coverage Δ
ubuntu-latest_3.10_mariadb-10.3 89.07% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.10_mariadb-10.4 89.07% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.10_mariadb-10.5 89.05% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.10_mariadb-10.6 89.05% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.10_mariadb-10.7 89.05% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.10_mariadb-10.8 89.05% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.10_mysql-5.7 89.75% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.10_mysql-8.0 91.14% <50.00%> (-1.13%) ⬇️
ubuntu-latest_3.11-dev_mariadb-10.3 89.03% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.11-dev_mariadb-10.4 89.03% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.11-dev_mariadb-10.5 89.02% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.11-dev_mariadb-10.6 89.02% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.11-dev_mariadb-10.7 89.02% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.11-dev_mariadb-10.8 89.02% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.11-dev_mysql-5.7 89.72% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.11-dev_mysql-8.0 91.10% <50.00%> (-1.13%) ⬇️
ubuntu-latest_3.7_mariadb-10.3 88.46% <50.00%> (-1.17%) ⬇️
ubuntu-latest_3.7_mariadb-10.4 88.46% <50.00%> (-1.17%) ⬇️
ubuntu-latest_3.7_mariadb-10.5 88.44% <50.00%> (-1.17%) ⬇️
ubuntu-latest_3.7_mariadb-10.6 88.44% <50.00%> (-1.17%) ⬇️
ubuntu-latest_3.7_mariadb-10.7 88.44% <50.00%> (-1.17%) ⬇️
ubuntu-latest_3.7_mariadb-10.8 88.44% <50.00%> (-1.17%) ⬇️
ubuntu-latest_3.7_mysql-5.7 89.18% <50.00%> (-1.17%) ⬇️
ubuntu-latest_3.7_mysql-8.0 90.65% <50.00%> (-1.19%) ⬇️
ubuntu-latest_3.8_mariadb-10.3 89.11% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.8_mariadb-10.4 89.11% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.8_mariadb-10.5 89.09% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.8_mariadb-10.6 89.09% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.8_mariadb-10.7 89.09% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.8_mariadb-10.8 89.09% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.8_mysql-5.7 89.79% <50.00%> (-1.12%) ⬇️
ubuntu-latest_3.8_mysql-8.0 91.16% <50.00%> (-1.13%) ⬇️
ubuntu-latest_3.9_mariadb-10.3 88.97% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.9_mariadb-10.4 88.97% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.9_mariadb-10.5 88.95% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.9_mariadb-10.6 88.95% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.9_mariadb-10.7 88.95% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.9_mariadb-10.8 88.95% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.9_mysql-5.7 89.65% <50.00%> (-1.11%) ⬇️
ubuntu-latest_3.9_mysql-8.0 91.02% <50.00%> (-1.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiomysql/connection.py 83.60% <50.00%> (-0.66%) ⬇️
tests/test_issues.py 85.66% <0.00%> (-0.27%) ⬇️
tests/test_connection.py 100.00% <0.00%> (ø)
tests/_testutils.py 0.00% <0.00%> (ø)
tests/base.py 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Nothing4You
Copy link
Collaborator Author

not sure why mysql 8.0 fails auth through haproxy, it works just fine when i run it locally, although without containers.
i'll probably need to fire up a linux vm to be able to replicate it more accurately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for passing in connection arg or existing SSL connection to aiomysql.connect()
1 participant