I need to connect to PostgreSQL db via SSL. I received 2 certificates and 1 key -> sslrootcert=root.crt sslcert=postgresql.crt and sslkey=postgresql.key.der
Here is my import config from Dataproc:
import
-Dmapreduce.job.user.classpath.first=true
-Dhadoop.security.credential.provider.path=jceks://hdfs/secrets/prod/db.jceks
--connect=jdbc:postgresql://xxx.x.x/DBNAME?sslrootcert=root.crt&sslcert=postgresql.crt&sslkey=postgresql.key.der
--username=user1
--table=db1
--target-dir=gs://bucket
--delete-target-dir
--as-avrodatafile
--password-alias=password
The Dataproc coundn't find my SSL certificates:
Error: java.lang.RuntimeException: java.lang.RuntimeException: org.postgresql.util.PSQLException: Could not open SSL certificate file postgresql.crt
How I could add certificates and key to dataproc to be sure that these certs be accessible in connection config.
Where I should store SSL certificates to use them in import config during run job :
--connect=jdbc:postgresql://xxx.x.x/DBNAME?sslrootcert=/???/??/root.crt&sslcert=/???/??/postgresql.crt&sslkey=/???/??/postgresql.key.der