0

I'm trying to connect to a free tier Heroku database from the Wolfram Language. The DatabaseLink package uses JDBC to make the connection. When I specify that SSL should be used for the connection, I get:

JDBC: SSL error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

The support article at: https://reference.wolfram.com/language/DatabaseLink/tutorial/SecureSocketLayer.html

... seems to suggest that one needs to get the security certificate for the site, generate a "truststore" file, and then load the JVM in a way that specifies which truststore file should be used.

I'm unsure if this is leading me in the right direction or not. But as of now, I'm unsure how I would go about getting this security certificate.

4

1 回答 1

0

我似乎偶然发现了至少一种解决我所看到的失败的方法,如“使用 SSL 而没有证书验证”部分所述:

https://jdbc.postgresql.org/documentation/head/ssl-client.html

我可以sslfactory通过以下方式指定选项:

OpenSQLConnection[
    ...,
    "Properties" -> {"ssl" -> "true", "sslfactory" -> "org.postgresql.ssl.NonValidatingFactory"}
]

现在数据库连接成功了。

于 2021-07-01T21:13:36.567 回答