How to connect to a remote MySQL database via SSL using Play Framework?

前端 未结 2 1546
南方客
南方客 2020-12-04 16:00

I deploy Play applications in distributed environments, backed by a remote MySQL database. Specifically, the applications are hosted on heroku, and the database is on Amazo

2条回答
  •  执念已碎
    2020-12-04 16:33

    Just to update on All.

    1. You can download the bundle certificate which contains many certificates of Amazon from here https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem.
    2. If you see the content of that pem it contains many certificates. Split it to multiple PEM files where each file will contain like this

      -----BEGIN CERTIFICATE-----
          [main content]
      -----END CERTIFICATE-----
      
    3. Then run this command for every cert file that you created

      keytool -import \
      -keystore  $JAVA_HOME/jre/lib/security/cacerts \
      -storepass changeit -noprompt \
      -alias $ALIAS -file $YOUR_INDIVIDUAL_PEM_FILE
      

    Just for making your life easy somebody has just created bash script for this : https://gist.github.com/shareefhiasat/dabe5e96dbd7123c7b101aac1c0eca8a

提交回复
热议问题