【发布时间】:2017-06-05 04:59:17
【问题描述】:
我成功地使用 MySQL Workbench 在 Bluemix 托管的 MySQL Compose 服务上完成了完整的 crud。
然后,我使用 SpringBoot 在本地笔记本电脑上使用 Apache Derby 构建了一个简单的微服务...成功。
我的下一步是使用托管在 Bluemix 中的 MySQL Compose。
我编辑了 application.properties 并遇到了这个错误 “PKIX 路径构建失败:....” "SunCertPathBuilderException: 无法找到请求目标的有效证书路径"
application.properties file
spring.jpa.hibernate.ddl-auto=create
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
spring.datasource.url=jdbc:mysql://somedomain:port/compose?useSSL=true?requireSSL=true
spring.datasource.username=myname
spring.datasource.password=mypassword
Bluemix 在 json 中为我提供了这些凭据:
{
"db_type": "mysql",
"name": "bmix-dal-yp-xxxxxxx-",
"uri_cli": "mysql -u myname -p --host somedomain.com --port 5555 --ssl-mode=REQUIRED",
"ca_certificate_base64": "LS0tLS1CRUd......",
"deployment_id": "58fexxxxxxxxxxx",
"uri": "mysql://myname:mypassword@somedomain.com:55555/compose"
}
我应该在 application.properties 的某处使用 ca 证书吗?
我需要在默认使用 springBoot 运行的嵌入式 tomcat 服务器上启用 ssl 吗?
如何配置我的 springBoot 应用程序以使用 SSL 和他们提供的 json 连接到我的云提供商 MySQL 实例?
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
【问题讨论】:
标签: mysql ssl spring-boot ibm-cloud compose-db