JDBC + SSL = "No trusted certificate found"

From: Luke McCarthy (luke.mccarthy_at_shaw.ca)
Date: 06/24/04


Date: Thu, 24 Jun 2004 11:31:20 -0600

Hi,

I'm trying to get JDBC to connect to a MySQL database using SSL. The MySQL
server has been propertly compiled and configured, and I can connect to it
with the regular client using SSL, but I can't get a simple test client
written in Java to work.

The error I'm getting is "No trusted certificate found", but I have
imported the CA cert I used to sign the MySQL server key into a truststore
and I'm using that truststore in my code. The relevant steps look like
this:

# CA cert created like so:
$ openssl req -new -x509 -keyout cakey.pem -out cacert.pem

# MySQL server certificate verified like so:
$ openssl verify -CAfile cacert.pem server-cert.pem
server-cert.pem: OK

# truststore created like so:
$ keytool -import -file cacert.pem -alias mysqlServerCACert -keystore
truststore

/* java code looks like this: */
System.setProperty("javax.net.debug", "all");
System.setProperty("javax.net.ssl.trustStore",
"/home/lukem/src/ssl/truststore");
System.setProperty("javax.net.ssl.trustStorePassword", "password");

During execution, the debug information shows that it's using the expected
truststore and that it's adding my certificate:

...
trustStore is: /home/lukem/src/ssl/truststore
...
adding as trusted cert:
Subject: CN=lewzealand, OU=bioinfo, O=Uni, L=Sask, ST=Sask, C=CA
...

But I still get the "No trusted certificate found" error. Any idea what
the problem might be? Thanks,

Luke



Relevant Pages

  • RE: MySQL/PHPMyAdmin on FC3 Connection Problem
    ... // You can disable a server config entry by setting host to ''. ... MySQL server ... MySQL control user settings ... table to describe the display fields ...
    (Fedora)
  • Re: Using Access for web application?
    ... Any suggestions as to which newsgroup would be more ... The server that the web app will use in this case, ... > which technology you will decide to use as the Web server (Linux or Windows) ... Instead MySQL is being ...
    (microsoft.public.access.dataaccess.pages)
  • [UNIX] phpMyAdmin PHP Code Injection (left.php)
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... phpMyAdmin is "web-based MySQL ... does not prevent a malicious user from altering the servers configuration ... server configurations to the list of servers configuration by adding ...
    (Securiteam)
  • Re: Using MySQL as the backend
    ... I need to learn MySQL, ... > the impression you're not familiar with the concept of a server DB. ... > doesn't need to have Access installed to access the database, ... >> install the server or maybe I have it installed but I just don't know how to ...
    (microsoft.public.access.tablesdbdesign)
  • Re: mySQL and ASP, ASP.NET and FP server extension
    ... If you're hosted on a Windows server, you can use MS Access, which is free, ... >>> Indeed, I was not thinking mySQL before, because Windows-based platform ... >>> usually comes with MS SQL and ASP and so on. ...
    (microsoft.public.frontpage.programming)