PostgreSQL SSL无法连接

时间:2019-01-16 19:06:10

标签: database postgresql ssl ssl-certificate

我正在尝试将一个名为Thingsboard的应用程序与一个都在Google Cloud Engine上运行的postgresql DB连接。 将数据库设置为仅允许SSL连接时,我有GCE提供的以下文件:

client-cert.pem client-key.pem server-ca.pem

这是建立与数据库的连接的地方。我尝试使用client-key.pem作为client-key.pem,client-key.key,client-key.pk8(带有和不带有密码短语,当添加密码短语时,我添加了字段“ sslpassword = MYKEY”

url: "${SPRING_DATASOURCE_URL:jdbc:postgresql://DATABASEIP:5432/thingsboard?sslmode=verify-ca&sslrootcert=/etc/thingsboard/conf/keystore/server-ca.pem&sslcert=/etc/thingsboard/conf/keystore/client-cert.pem&sslkey=/etc/thingsboard/conf/keystore/client-key.pk8}"
username: "${SPRING_DATASOURCE_USERNAME:MYDBUSERNAME}"
password: "${SPRING_DATASOURCE_PASSWORD:MYDBPASSWORD}"

我遇到以下错误

2019-01-16 18:55:32,866 [localhost-startStop-1] ERROR o.a.tomcat.jdbc.pool.ConnectionPool - Unable to create initial connections of pool.
org.postgresql.util.PSQLException: Could not read SSL key file /etc/thingsboard/conf/keystore/client-key.pk8.

0 个答案:

没有答案