简体   繁体   中英

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?

I assume the JDBC driver needs access to the certificate to make an encrypted SSL (TLS) connection to the database server. But how do I make the certificate available to the JDBC driver during development and at deployment?

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. If you use a different factory, then you need to jump through keytool's hoops, as described in the docs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM