| 86 | |
| 87 | |
| 88 | def test_caching_sha2_password_ssl(): |
| 89 | con = pymysql.connect( |
| 90 | user="user_caching_sha2", |
| 91 | password=pass_caching_sha2, |
| 92 | host=host, |
| 93 | port=port, |
| 94 | ssl=ssl, |
| 95 | ) |
| 96 | con.close() |
| 97 | |
| 98 | # Fast path of caching sha2 |
| 99 | con = pymysql.connect( |
| 100 | user="user_caching_sha2", |
| 101 | password=pass_caching_sha2, |
| 102 | host=host, |
| 103 | port=port, |
| 104 | ssl=ssl, |
| 105 | ) |
| 106 | con.query("FLUSH PRIVILEGES") |
| 107 | con.close() |
| 108 | |
| 109 | # Fast path after auth_switch_request |
| 110 | pymysql.connections._DEFAULT_AUTH_PLUGIN = "mysql_native_password" |
| 111 | con = pymysql.connect( |
| 112 | user="user_caching_sha2", |
| 113 | password=pass_caching_sha2, |
| 114 | host=host, |
| 115 | port=port, |
| 116 | ssl=ssl, |
| 117 | ) |
| 118 | con.query("FLUSH PRIVILEGES") |
| 119 | con.close() |
| 120 | pymysql.connections._DEFAULT_AUTH_PLUGIN = None |