JDBC+SSL?



OK, I am working with MySQL and Postgres. Both indicate I can create
connections to them using SSL so that data exchanged with them is
encrypted while in transit. The question is,"How do I use JDBC to
create a secure connection instead of a clear text connection?"

What would I change in the following to ensure sensitive data is
encrypted between my servlet and the database back end?

String driver = "org.postgresql.Driver";
try {
Class.forName(driver);
} catch (ClassNotFoundException e1) {
RequestDispatcher dispatcher =
request.getRequestDispatcher("/LoginError.jsp");
dispatcher.forward(request, response);
}
String url = "jdbc:postgresql://localhost/People";
// credentials offered by the user
String user = lBean.getUid();
String pword = lBean.getPword();
try {
Connection con = DriverManager.getConnection(url, user,
pword);
} catch (SQLException e2) {
RequestDispatcher dispatcher =
request.getRequestDispatcher("/LoginError.jsp");
dispatcher.forward(request, response);
}
// code to assess user credentials offered and redirect
accordingly

I think I know how to tell my database servers what certificate to use,
but how do I tell JDBC what certificate to use, and how do I tell both
servers to accept the certificates I've created for them? I am not
sure, though, because I have not figured out how to use JDBC to test
it. These certificates will be self signed, but that's OK since I
trust myself.

Any ideas?

Thanks

Ted

R.E. (Ted) Byers, Ph.D., Ed.D.
R & D Decision Support Software
http://www.randddecisionsupportsolutions.com/

.



Relevant Pages

  • Re: Does L2TP actually WORK ? Drama on XP
    ... >Stop multiposting and find the correct newsgroup for VPN ... Into the DC and configured the automatic certificate ... >> WinXP box back to the isolated Internet hub connection. ... >> The L2TP connection attempt failed because security ...
    (microsoft.public.windowsxp.security_admin)
  • Re: L2TP Bug, win2003 and WinXP
    ... Into the DC and configured the automatic certificate ... > WinXP box back to the isolated Internet hub connection. ... (The specified domain either does not ... then I setup the L2TP connection as it says in the ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Does L2TP actually WORK ? Drama on XP
    ... Stop multiposting and find the correct newsgroup for VPN related stuff. ... Into the DC and configured the automatic certificate ... > WinXP box back to the isolated Internet hub connection. ... (The specified domain either does not ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Problem with RWW, can list computers/servers, cannot get logge
    ... > other RWW functionality including admining the companyweb. ... > When I browse to that FQDN and the certificate is presented for approval, ... >>> to which the network in connected. ... >>> connection might not be enabled or the computer might be too bust to ...
    (microsoft.public.windows.server.sbs)
  • Re: L2TP/IPSec from XP client to Windows 2003 Server
    ... ie no valid cert found on client - contacted Microsoft ... Windows Server 2003 Certificate Authority running ... The next step is to install Certificate Services on the Windows Server ... From Networks Connections on the client, ...
    (microsoft.public.security)