spring - 使用 Spring Cloud 连接器和 HikariCP 配置 Postgresql sslrootcert
问题描述
我目前正在尝试使用 Spring Cloud Connectors 在我的 SpringBoot 2.1.1 应用程序上设置一个数据源(Postgresql)(我的应用程序托管在 PCF 上)。我需要配置我的 sslrootcert 的路径(在我们在 PCF 上使用的服务代理提供的 jdbc url 中没有指定)。
我试过这样配置它:
@Bean
public DataSource dataSource() {
DataSourceConfig dataSourceConfig = new DataSourceConfig(null, new DataSourceConfig.ConnectionConfig("sslrootcert=/home/vcap/app/.postgresql/root.crt"), Collections.singletonMap("sslrootcert", "/home/vcap/app/.postgresql/root.crt"));
return connectionFactory().dataSource(dataSourceConfig);
}
但我的 sslrootcert 属性总是被忽略并回退到默认值 ~/.postgresql/root.crt
我在文档中找不到任何关于设置这种驱动程序特定属性的方法。
任何形式的帮助将不胜感激。
解决方案
推荐阅读
- python - python程序反转列表可迭代问题
- c++ - 在 Visual Studio C++ 上使用 CUDA 编译错误 CMAKE
- typescript - 解决用户自定义类名与内置类名冲突
- c - 修改CRC64的哈希表生成65536而不是256个值
- apache-spark - 有没有办法让 Spark Streaming 应用程序在 Job 中止时退出
- python - 在 Windows 目录中用于代替用户名文件夹的任何通用关键字
- youtube - 一些观众也观看了这个 youtube 频道
- python - usercreationform 不显示任何字段
- python - Pyinstaller - 通过 .bat 文件隐藏和运行可执行文件
- java - 在Angular 8应用程序中上传媒体文件时如何从rest api返回响应?