4

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.

1

1 Answer 1

6

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

https://docs.amazonaws.cn/en_us/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.SSL

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.