1
0
-1

Hi,

I have a Cloud account,

I'm trying to connect to my external MySQL Server v.8.0.21 with SSL enabled using JDBC connector to populate a select box in a Form. 

To authenticate my user I've created a new user called joget ;

mysql> CREATE USER 'joget'@'ec2-54-215-231-212.us-west-1.compute.amazonaws.com' IDENTIFIED BY 'PASSWORD' REQUIRE SSL;
mysql> GRANT ALL PRIVILEGES ON example.* TO 'joget'@'ec2-54-215-231-212.us-west-1.compute.amazonaws.com';
mysql> FLUSH PRIVILEGES;

and setup my jdbc binder as follow;

jdbc:mysql://server:port/database?characterEncoding=UTF8&useSSL=true&AllowPublicKeyRetrieval=true

......and raised a ERROR;


Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target



Setting useSLL=false ;  [ In this case I have to use a different User with non-SSL enabled] 

jdbc:mysql://server:port/database?characterEncoding=UTF8&useSSL=false

Caused by: java.sql.SQLException: Could not connect to address=(host=Server)(port=3306)(type=master) : RSA public key is not available client side (option serverRsaPublicKeyFile not set)

I really waste now a day googling around and found the following Troubleshoot which actually could solve the problem:)

Following the instruction, I've validated my Servers public_key and copy/store it under my App resources to provide the link for serverRSAPublicKey= /jw/web/app/..../public_key.pem and gave another try. 

jdbc:mysql://server:port/database?characterEncoding=UTF8&useSSL=false&serverRSAPublicKeyFile=/jw/..pathTo../public_key.pem

Actually I've used many other combination's and don't know how to solve my connection problem.




    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi, according to Problem connecting external Database in Joget onDemand, some cloud plans do not allow remote database connections.

        CommentAdd your comment...