I am trying to connect existing spring boot application from EC2(RHEL 8) to RDS Postgres database. Both RDS and EC2 are in the same private VPC.
Connection establishment is working fine from my local spring boot application without SSL to RDS. From Pgadmin4, i could connect with or with SSL. No luck from EC2. getting "org.postgresql.util.PSQLException: SSL error: Received fatal alert: handshake_failure" while starting the application.
telnet is successful from EC2 to RDS db instance. Not sure what I am missing, I am stuck.
I cannot change application code at this point.
What I have tried:
- In EC2 security group, inbound rules are
- In RDS security group, inbo
und rules are, - I downloaded rds region cerficate and copied in /etc/pki/ca-trust/source/anchors/ and also under JVM location (.........openjdk-8u432-b06-Build/jre/lib/security/cacerts)
- Generated JKS, CRT files from .pem file and copied that under JVM location.
- I have also tried the below configurations from application.properties file.
server.ssl.keyStore=truststore.jks
server.ssl.keyStorePassword=changeit
server.ssl.keyStoreType=JKS
#With or without the below
server.ssl.enabled=true
server.ssl.key-store=truststore.jks
server.ssl.key-store-password=changeit
server.ssl.key-storetype=JKS
#With or without the below
server.ssl.enabled=true
