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

增加对mysql的caching_sha2_password认证插件fullauth流程支持 #4767

Conversation

bygaoyuan
Copy link
Contributor

环境描述:
MYSQL服务端版本:8.0.30
Canal:1.1.6
关联Issues: #1700
背景:采用caching_sha2_password插件认证,客户端首次连接MySQL服务端/在MYSQL服务端执行flush privileges;,报caching_sha2_password Auth failed。非首次连接则可以正常认证。
复现情况:稳定复现
原因:
从 MySQL 8.0.4 开始,MySQL 默认身份验证插件从 mysql_native_password 改为 caching_sha2_password。
Canal目前支持了caching_sha2_password插件Fast auth功能。
相关commit为:b95c0d03cf42e8637b72b7f2d2dbfab894bef1aa
非首次连接可以正常认证的原因为触发了caching_sha2_password的Fast Auth功能。
本次代码新增了caching_sha2_password的Full Auth功能中从服务端获取public key,然后进行Auth逻辑。实现了在使用caching_sha2_password插件下Canal可以正常连接MYSQL的功能。
相关文档:https://dev.mysql.com/doc/dev/mysql-server/latest/page_caching_sha2_authentication_exchanges.html
单元测试:
执行了com/alibaba/otter/canal/parse/driver/mysql/MysqlConnectorTest.java

@CLAassistant
Copy link

CLAassistant commented Jun 17, 2023

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


gaoyuan seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@bygaoyuan bygaoyuan force-pushed the add_mysql_caching_sha2_password_full_auth_rsa branch from 1ea0897 to 399931d Compare June 17, 2023 09:36
@agapple agapple self-assigned this Jul 18, 2023
@agapple agapple added this to the v1.1.7 milestone Jul 18, 2023
@agapple agapple merged commit b8c2a75 into alibaba:master Jul 18, 2023
@agapple
Copy link
Member

agapple commented Jul 18, 2023

tks

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.

3 participants