java Public Key Retrieval is not allowed 解决方法
时间: 2023-10-30 11:07:29 浏览: 37
这个问题通常出现在Java应用程序中,它表示远程主机的公钥没有被找到或检索。这可能是由于不可信证书或证书未被正确配置引起的。
解决方法:
1. 检查您的证书。确保您将证书导入到信任存储区域中。
2. 确认您使用的协议是否正确安装了安全套接字协议管理器(JSSE)。
3. 确认您的代码中的URL是否包含“https”,这将使JSSE处理。
4. 如果您正在从远程站点获取公钥,则请确保您的URL正确,并启用相应的协议。
5. 如果您在使用代理,则请确保可以直接连接到远程站点,或考虑为代理配置安全套接字隧道。
6. 如果您仍然遇到问题,请尝试与产品支持或开发人员联系,以获取进一步帮助。
希望这可以帮助您解决问题。
相关问题
Public Key Retrieval is not allowed Public Key Retrieval is not allowed
回答: "Public Key Retrieval is not allowed"错误通常是由于禁用了SSL/TLS协议传输导致的。在禁用SSL/TLS协议传输后,客户端需要使用服务器的公钥进行传输,但默认情况下客户端不会主动去找服务器拿公钥,从而导致错误的出现。\[2\]解决这个问题的方法有以下几种:一是启用TLS作为首选机制,确保可用;二是设置AllowPublicKeyRetrieval=True,允许客户端自动从服务器请求公钥;三是使用ServerRSAPublicKeyFile连接字符串设置服务器的RSA公钥。需要注意的是,启用AllowPublicKeyRetrieval=True可能会增加恶意代理执行MITM攻击以获取明文密码的风险,因此默认情况下是禁用的,需要显式启用它。\[3\]
#### 引用[.reference_title]
- *1* *2* [Public Key Retrieval is not allowed解决](https://blog.csdn.net/weixin_55599565/article/details/125140094)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [DBeaver连接时报错:Public Key Retrieval is not allowed Public Key Retrieval is not allowed](https://blog.csdn.net/qq_42971035/article/details/120247453)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
Public Key Retrieval is not allowed 解决
Public Key Retrieval is not allowed是由于MySQL连接URL中没有启用allowPublicKeyRetrieval选项导致的。要解决此问题,可以按照以下步骤操作:
1.在MySQL连接URL中添加&allowPublicKeyRetrieval=true选项,例如:
```python
mysql+mysqlconnector://user:password@host/dbname?&allowPublicKeyRetrieval=true
```
2.如果第一步无效,则可以尝试在MySQL连接URL中添加&ssl-mode=REQUIRED选项,例如:
```python
mysql+mysqlconnector://user:password@host/dbname?&ssl-mode=REQUIRED
```
这将强制使用SSL连接,从而允许公钥检索。
3.如果以上两个步骤都无效,则可以尝试在MySQL服务器上启用allowPublicKeyRetrieval选项。在MySQL配置文件中添加以下行:
```shell
[mysqld]
allow_local_infile=1
```
相关推荐
![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)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)