Mysql8- Public Key Retrieval is not allowed

After restarting the application using MySQL 8.0 when prompted com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed

The easiest solution is to add a connection in the back allowPublicKeyRetrieval=true

Document ( explanation given https://mysql-net.github.io/MySqlConnector/connection-options/) are :

If the user sha256_passwordauthentication, the password must be protected TLS protocol during transmission, but if the RSA public key is not available, the server can use the public key;
can be specified by the RSA public key ServerRSAPublicKeyFile server in the connection, or AllowPublicKeyRetrieval = True parameters to allow the client to obtain the public key from the server;
it should be noted that AllowPublicKeyRetrieval = True could result in a malicious agent to obtain the plaintext password-middle attack (MITM), so is off by default and must be explicitly turned on

Guess you like

Origin www.cnblogs.com/nxzblogs/p/11966120.html