B4J Question JDBC MySql ssl

Fabrice La

Active Member
Licensed User
Longtime User
Hi I am trying to connection my Database using ssl.

On windows I do:
mysql -uUuss -pPaass -P3306 --ssl --ssl-ca="C:\OpenSSL-Win64\newcerts\ca-cert.pem"

And it's work

How to do the same on the JDBC:
StringSql = jdbc:mysql://localhost:3306/ndf?characterEncoding=utf8&useSSL=true&serverSslCert="C:\OpenSSL-Win64\newcerts\ca-cert.pem"

MySql.Initialize2("com.mysql.jdbc.Driver", StringSql,BaseConnect.LoginB,BaseConnect.MDP)
 

Fabrice La

Active Member
Licensed User
Longtime User
Yeb Tried that:
B4X:
jdbc:mysql://localhost:3306/ndf?characterEncoding=utf8&useSSL=true&serverSslCert=C:/OpenSSL-Win64/newcerts/ca-cert.pem
With the error:
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
 
Upvote 0

Fabrice La

Active Member
Licensed User
Longtime User
I found that:
http://stackoverflow.com/questions/16523595/specify-ssl-to-be-used-for-jdbc-in-context-xml
or in:
I am on the test machine and this application will be install on a network server where it will be possible to access through internet.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…