| 52 | |
| 53 | |
| 54 | def test_caching_sha2_password(): |
| 55 | con = pymysql.connect( |
| 56 | user="user_caching_sha2", |
| 57 | password=pass_caching_sha2, |
| 58 | host=host, |
| 59 | port=port, |
| 60 | ssl=None, |
| 61 | ) |
| 62 | con.close() |
| 63 | |
| 64 | # Fast path of caching sha2 |
| 65 | con = pymysql.connect( |
| 66 | user="user_caching_sha2", |
| 67 | password=pass_caching_sha2, |
| 68 | host=host, |
| 69 | port=port, |
| 70 | ssl=None, |
| 71 | ) |
| 72 | con.query("FLUSH PRIVILEGES") |
| 73 | con.close() |
| 74 | |
| 75 | # Fast path after auth_switch_request |
| 76 | pymysql.connections._DEFAULT_AUTH_PLUGIN = "mysql_native_password" |
| 77 | con = pymysql.connect( |
| 78 | user="user_caching_sha2", |
| 79 | password=pass_caching_sha2, |
| 80 | host=host, |
| 81 | port=port, |
| 82 | ssl=ssl, |
| 83 | ) |
| 84 | con.query("FLUSH PRIVILEGES") |
| 85 | con.close() |
| 86 | pymysql.connections._DEFAULT_AUTH_PLUGIN = None |
| 87 | |
| 88 | |
| 89 | def test_caching_sha2_password_ssl(): |