Cause: java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
时间: 2023-10-29 09:51:04 浏览: 67
This error occurs when attempting to establish a secure connection to a MySQL database using SSL/TLS and the server is configured to block public key retrieval. This can happen for a variety of reasons, including security policies or outdated server configurations.
To resolve this error, you can try the following steps:
1. Check the MySQL server configuration to ensure that public key retrieval is allowed. This can usually be done by modifying the server's my.cnf file and adding the following line: `ssl-mode=VERIFY_IDENTITY`
2. If the server configuration is correct, check that the SSL/TLS certificate being used is valid and not expired. You can do this by checking the certificate expiration date and ensuring that the certificate was issued by a trusted certificate authority.
3. If the certificate is valid, try updating the MySQL JDBC driver to the latest version. This may resolve any compatibility issues with the server configuration.
4. If all else fails, contact your database administrator or hosting provider for assistance in resolving the issue.
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)