Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / June 2004

Tip: Looking for answers? Try searching our database.

javax.net.ssl.SSLException: untrusted server cert chain with FireFox

Thread view: 
Red Winestain - 15 Jun 2004 15:35 GMT
For an in-house project, I have a web server (Apache) with a
self-signed certificate. I can access everything via https: just fine.
The reason for wanting https is to add security to the .htaccess
passwords.  This all works just fine.

FWIW, I'm using FireFox, and simply added the self-signed certificate.

However, no Java applets will load.  I get the following when trying
to load InHouseApp (one of the applets):

load: class InHouseApp not found.
java.lang.ClassNotFoundException: javax.net.ssl.SSLException:
 untrusted server cert chain
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a([DashoPro-V1.2-120198])
[rest deleted]

I have complete access to the various client machines (both desktops
on the lan, and laptops that will be out in the wild). What do I need
to add to prevent this exception? Also, as certificates aren't my
strong suit, are there any step-by-step detail instructions on what to
do?

TIA
KC Wong - 21 Jun 2004 05:00 GMT
> load: class InHouseApp not found.
> java.lang.ClassNotFoundException: javax.net.ssl.SSLException:
[quoted text clipped - 7 lines]
> strong suit, are there any step-by-step detail instructions on what to
> do?

Certificates are signed by known Certificates Authorities (CA). Their certs
are called the root certs. CAs used their root certs to sign an intermediate
cert, which are in turn used to sign certificates issued to companies.

Browsers and JVM have a list of those root and intermediate certs (public
key only), and will verify any certs that comes along with them. While
browsers will have a pop-up and ask you to trust the suspicious cert (your
self-signed cert) or not, JVM doesn't (since not all applications are
interactive, and not all platforms has display). So the exception is thrown.

So what you need to do is to import your self-signed cert into the "cacerts"
keystore of the JVM, so it will be trusted.

The tool to use is called "keytool". It is in the JDK bin directory.

A sample command line:
keytool -import -alias <alias> -file <certfile> -keypass
<password> -keystore <keystore> -storepass <storepass>

<alias> is the name to assign to the cert being imported. You can retrieve a
list of cert names with keytool -list. It is best to use something
meaningful so you can find your self-signed cert easily.
<certfile> is the path to the cert being imported.
<password> is the password of the cert being imported.
<keystore> is the keystore of the JVM to use. For my JRE, it is "C:\Program
Files\Java\j2re1.4.2_04\lib\security\cacerts" (no file extension). You can
create your own keystores, but for this purpose, you use the "cacert" one.
<storepass> is the password of the keystore. The JVM cacert keystore has a
default password of "changeit" (without the quotes).

HTH,

KC


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.