java - 不建议在没有服务器身份验证的情况下建立 SSL 连接

标签 java json ssl

我尝试通过 POSTMAN 访问我的简单 API 调用。它在浏览器中工作时不起作用。

按如下所示更改数据库连接 URL 后尝试。

jdbc:mysql://localhost:3306/BLOG_ERA?useSSL=false

即使它不起作用。

WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

最佳答案

这只是一个警告,不是错误。

如果它在浏览器中工作而不是在 Postman 中工作,则问题很可能出在 URL 而不是数据库连接中。确保您在 Postman 中使用完全相同的 URL。大多数人错误地在 Postman 的 URL 中使用 http 而不是 https

关于java - 不建议在没有服务器身份验证的情况下建立 SSL 连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52886322/

相关文章:

java - java 如何验证证书以及为什么我收到 SSLHandshakeException

javascript - 使用 Fetch API 访问 JSON

json - 在 Swift 中解码嵌套 JSON 对象的便捷方法?

apache - 由于 SSLProtocol : Illegal protocol 'TLSv1.1' error,httpd 未启动

java - SSLSocket 不执行主机名验证

c# - 如何撤销 WCF 中的客户端证书?

java - 如何将 Map 转换为 Bytes 并保存到内部存储

java - 从 servlet 调用映射作业时出错

java - 什么时候使用私有(private)构造函数有用?

java - 如何使用 GSON 从 JSON 中提取字段