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 / November 2004

Tip: Looking for answers? Try searching our database.

untrusted certificate for testing: Untrusted Server Certificate Chain

Thread view: 
Dieter Salath? - 08 Nov 2004 17:16 GMT
Hi
I want to test my application which connects to a https site. The
certificate is NOT trusted with a root certification authority.
I get the following error:

Caused by: javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException: Untrusted Server Certificate
Chain: unable to load file https://bas02742/dt/objectManager?wsdl
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

How can I get rid of this error without a trusted certificate? Any
hints are greatly appreciated

Cheers
Dieter
Ferenc Hechler - 08 Nov 2004 19:10 GMT
Hi Dieter,
just a hint to search for further resources:
You need to create and set your own local keystore.
There is a program called keytool shipped with the java binaries which you
will need.
bye,
  feri
Rogan Dawes - 09 Nov 2004 09:00 GMT
> Hi
> I want to test my application which connects to a https site. The
[quoted text clipped - 13 lines]
> Cheers
> Dieter

Two possibilities.

Import the CA certificate that signed your test cert into your java
keystore.

Modify your code to include an X509TrustManager, and pass it to
SSLContext.init

<http://java.sun.com/j2se/1.4.2/docs/api/javax/net/ssl/SSLContext.html#init(javax
.net.ssl.KeyManager[],%20javax.net.ssl.TrustManager[],%20java.security.SecureRan
dom
)>

Also see
<http://java.sun.com/j2se/1.4.2/docs/api/javax/net/ssl/TrustManagerFactory.html#g
etTrustManagers
()>

Hope this helps.

Rogan
Signature

Rogan Dawes

*ALL* messages to discard@dawes.za.net will be dropped, and added
to my blacklist. Please respond to "nntp AT dawes DOT za DOT net"



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.