1:
попробуйте добавить все сертификаты по цепочке доверия
2:
добавляем сертификаты в java
https://stackoverflow.com/questions/2893819/accept...
File crtFile = new File("server.crt");
Certificate certificate = CertificateFactory.getInstance("X.509").generateCertificate(new FileInputStream(crtFile));
CertificateFactory.getInstance("X.509").generateCertificate(this.class.getClassLoader().getResourceAsStream("server.crt"));
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
keyStore.load(null, null);
keyStore.setCertificateEntry("server", certificate);
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(keyStore);
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, trustManagerFactory.getTrustManagers(), null);
подключаемся к бд с connection source С ssl=true и другими нужными параметрами
https://jdbc.postgresql.org/documentation/head/con...
https://jdbc.postgresql.org/documentation/head/ssl...