How to enable SSL for Amazon RDS Mysql in Spring Boot / Spring Data?

Currently, the spring boot application using spring data is configured to use an unencrypted connection to an Amazon RDS instance. I want to prevent listening to data on the transport, so I want to enable SSL between the application and the database instance.

My connection is configured using the stock properties available in spring boot.

in my .properties applications, I use the following to configure the database connection.

spring.datasource.catalog=MYDB spring.datasource.url=jdbc:mysql://INSTANCEURL/${spring.datasource.catalog}?verifyServerCertificate=true&useSSL=true&requireSSL=true spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.username=USERNAME spring.datasource.password=PASSWORD 

Despite using URI variables that allow SSL at the URL, there is no configuration for specifying the PEM file provided by Amazon to encrypt connections.

Ideally, I would prefer a built-in certificate access solution

+5
source share
1 answer

After further research, the implementation of the security certificate is an anti-pattern, and instead, the certificate is installed in the path and then referenced inside the JVM.

0
source

Source: https://habr.com/ru/post/1237812/


All Articles