[英]Where to put the .crt CA certificate file downloaded from Digital Ocean for a SSL connection to their Managed PostgreSQL server
In a simple HelloWorld app using JDBC to make a connection to the Managed PostgreSQL servers by Digital Ocean, where does one place the downloaded ca-certificate.crt
file downloaded from their "Getting Started" page?在一个简单的 HelloWorld 应用程序中,使用 JDBC 连接到 Digital Ocean 托管的 PostgreSQL服务器,从他们的“入门”页面下载的
ca-certificate.crt
文件放在哪里?
I assume the JDBC driver needs access to the certificate to make an encrypted SSL (TLS) connection to the database server.我假设 JDBC 驱动程序需要访问证书才能与数据库服务器建立加密的 SSL (TLS) 连接。 But how do I make the certificate available to the JDBC driver during development and at deployment?
但是,如何在开发和部署期间使证书对 JDBC 驱动程序可用?
You have different "factories" to choose from.你有不同的“工厂”可供选择。 If you use LibPQFactory (which may or may not be the default, depending on what sentence of the docs you trust), then you put the cert in the same place as you put it for libpq, ie for psql, which varies by your OS.
如果您使用 LibPQFactory(它可能是默认值,也可能不是默认值,具体取决于您信任的文档的哪一句),那么您将证书放在与 libpq 相同的位置,即 psql,这因您的操作系统而异. If you use a different factory, then you need to jump through keytool's hoops, as described in the docs .
如果您使用不同的工厂,那么您需要跳过 keytool 的箍,如 文档中所述。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.