【问题标题】:Spring Boot Connecting database using SSL CertificateSpring Boot 使用 SSL 证书连接数据库
【发布时间】:2019-10-24 01:13:11
【问题描述】:

我需要使用来自 Spring Boot 应用程序的 SSL 证书连接到 postgresql。我已经获得了证书,目前我正在使用我在 application.yml 文件中提供的用户名和密码连接到 db。

谁能指出我正确的教程?我找不到与 spring boot ssl 数据库连接相关的任何内容。

【问题讨论】:

标签: postgresql spring-boot ssl-certificate


【解决方案1】:

您需要在 URL 中附加以下内容

&sslmode=verify-full&sslrootcert=/path/to/pemfile

您的网址将类似于

jdbc:postgresql://server:5432/databaseName?currentSchema=dbschema
    &sslmode=verify-full&sslrootcert=/home/certificates/mycert.pem

您可以参考以下网址

https://jdbc.postgresql.org/documentation/head/connect.html#ssl

https://docs.amazonaws.cn/en_us/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.SSL

【讨论】:

    猜你喜欢
    • 2018-08-19
    • 2018-04-09
    • 2014-11-25
    • 2018-08-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-07
    • 2019-06-12
    相关资源
    最近更新 更多