我尝试通过 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/