Reputation: 1994
I need to connect to postgresql using SSL Certificate from spring boot application. I have got the certificate and currently i am connecting to db using username and password which i have provided in application.yml file.
Can someone point me to the right tutorial? I could not find anything relevant for spring boot ssl database connection.
Upvotes: 4
Views: 6537
Reputation: 2340
you need to append below in URL
&sslmode=verify-full&sslrootcert=/path/to/pemfile
Your URL will look something like
jdbc:postgresql://server:5432/databaseName?currentSchema=dbschema
&sslmode=verify-full&sslrootcert=/home/certificates/mycert.pem
you can refer below URLs
https://jdbc.postgresql.org/documentation/head/connect.html#ssl
Upvotes: 6