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

Please update Readme with SHA2 password authentication example. #113

Open
suchislife801 opened this issue Jun 6, 2021 · 6 comments
Open

Comments

@suchislife801
Copy link

suchislife801 commented Jun 6, 2021

Where is the working example for this feature? I still have no idea how to implement it.

@lideming
Copy link
Collaborator

lideming commented Jun 6, 2021

It should work without additional configuration on the client.
But there may be some problem for some MySQL server configuration as we didn't implement the Authentication Method Mismatch protocol.

@suchislife801
Copy link
Author

suchislife801 commented Jun 6, 2021

It does not work with Digital Ocean MySQL 8.0 Authetication. It does not either when Digital Ocean by passes it down to MySQL 5.x

image1

My Config example below. Are these settings correct as far as you know? Digital Ocean Managed Database.

caching_sha2_password_auto_generate_rsa_keys              ON
caching_sha2_password_private_key_path                    private_key.pem                                                                                                                                                                                                                                             
caching_sha2_password_public_key_path                     public_key.pem
default_authentication_plugin                             caching_sha2_password
sha256_password_auto_generate_rsa_keys                    ON                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
sha256_password_private_key_path                          private_key.pem                                                                                                                                                                                                                                                                                                                                                                                                                                                       
sha256_password_proxy_users                               OFF                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
sha256_password_public_key_path                           public_key.pem 
Caching_sha2_password_rsa_public_key                   -----BEGIN PUBLIC KEY-----                                                                                                                                                                                                                                                                                                                                                                                                                                           
                                                       MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs1cnMPdb/ve74aUw0oku                                                                                                                                                                                                                                                                                                                                                                                                     
                                                       JSUcAlmcPGSWknBR3fP5OX1wfLey/ES/mcPyAZ6TQ4X0liAiCP6hmVr9oncungK7                                                                                                                                                                                                                                                                                                                                                                                                     
                                                       cbG7JrwZjhOp5OUJ0yzDYEbEIRv6LRgD5wkj0U8SKc8ndFLrFTptbKgF7ZgySW6i                                                                                                                                                                                                                                                                                                                                                                                                     
                                                       IGZof6HCSRi7nbSOICi+cafTI7dN9Y+PYvIEHhEHeu2RY+mAK+WpiXUYR6+3e7Ur                                                                                                                                                                                                                                                                                                                                                                                                     
                                                       t0Kmq9+XkRH8ACcuvEoGQFCdz2FC8yB7ST6QKN6magClwd8218D6B8d99L6OoKAE                                                                                                                                                                                                                                                                                                                                                                                                     
                                                       lomYxLDTnARWnKFKNhnCqcUS9cAyKHPQxC5jvVBZ5+Go0hXXdJVlmIe0KeKVZjW+                                                                                                                                                                                                                                                                                                                                                                                                     
                                                       NwIDAQAB                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                       -----END PUBLIC KEY----- 

@suchislife801
Copy link
Author

Is there still no solution to to this? Nothing at all? The most IMPORTANT part of the project which is to connect, does not actually work.

@shiyuhang0
Copy link
Contributor

@lideming Is there any reference for Authentication Method Mismatch protocol? The link is invalid now. I'd like to do some research and willing to contribute if it is in my ablity

@lideming
Copy link
Collaborator

@shiyuhang0 It's the "Authentication Method Mismatch" part in Connection Phase (https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase.html). We have implemented only the "Authentication Phase Fast Path" currently and can not switch authentication method in case of the mismatch. Thanks for your research and PRs are welcome.

@shiyuhang0
Copy link
Contributor

@lideming PTAL #137
But I don't known how to test it.

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

No branches or pull requests

3 participants