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