Could not obtain connection to query metadata : Public Key Retrieval is not allowed

Posted JavaEdge.

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Could not obtain connection to query metadata : Public Key Retrieval is not allowed相关的知识,希望对你有一定的参考价值。

您应该将客户端选项添加到 mysql 连接器中,

allowPublicKeyRetrieval=true

以允许客户端自动从服务器请求公钥。

AllowPublicKeyRetrieval=True

允许恶意代理执行 MITM 攻击以获取纯文本密码,因此默认情况下它是false!必须显式开启。
也可以使用如下配置:

useSSL=false

所以,最终修改 db 配置如下即可:

jdbc:mysql://localhost:3306/db?allowPublicKeyRetrieval=true&useSSL=false

以上是关于Could not obtain connection to query metadata : Public Key Retrieval is not allowed的主要内容,如果未能解决你的问题,请参考以下文章

Could not obtain transaction-synchronized Session for current thread

Could not obtain transaction-synchronized Session for current thread

Could not obtain connection to query metadata : Public Key Retrieval is not allowed

Could not obtain transaction-synchronized Session for current thread

Could not obtain transaction-synchronized Session for current thread

org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thre