I am trying to establish a SSL connection with my MySQL database in Java using MySQL Connector/J (version 5.1.45) and this AWS RDS certificate here: https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem
But I am getting the following Exception:
java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
I could trace this Exception down to the MySQL Connector/J class ExportControlled.java on line 297:
CertPathValidatorResult result = this.validator.validate(certPath, this.validatorParams);
Then I can't go further down since this goes into the JRE security classes, like CertPathValidator.
Since I am using MySQL Connector/J to do the whole SSL magic, my hands are tied and I don't know what's going on or how to fix this. The certificate works fine on MySQL Workbench and on Intelli J IDEA Database, so I have no clue why it's being rejected now.
How do I fix this?