1

new spring boot application using spring data jpa and we need to connect oracle DB without password set in spring.datasource.password instead need to use connectionProperties with javax.net.ssl.truststore file and javax.net.ssl.truststorePassword.

please help me how we can go with approach to connect DB with spring data jpa?

existing application used same without DB password but used certificate to connect DB in jdbc template.

spring.datasource.url spring.datasource.driverClassName spring.datasource.username // No DB password here but we need to use certificates

javax.net.ssl.truststore = load cert file from file path javax.net.ssl.trustStoreType javax.net.ssl.truststorePassword = load encrypted cert password from file path

Muralidhar
  • 113
  • 1
  • 12

2 Answers2

0

Can you check the details in the blog? You do need the password along with the certificate. Certificate is to enable stronger security with SSL but not to eliminate database password.

Nirmala
  • 1,278
  • 1
  • 10
  • 11
0

You can leave oracle bound to localhost and use SSH tunnel on spring to connect to it. On the Oracle server use key to connect ssh instead of password.

Check out this: https://stackoverflow.com/a/71766760/4903232

Marco Lettieri
  • 98
  • 3
  • 11