• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

How do I get a hold of Java's default SSL Trust Manager?

 
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need my program to be able to make HTTPS posts. I know that you can disable server authentication by creating a new X509TrustManager as described here: http://www.exampledepot.com/egs/javax.net.ssl/TrustAll.html?l=rel. But what I really want is for my X509TrustManager to wrap the default TrustManager. Then if the default TM throws a CertificationException, my own X509TrustManager will have the option to squash it on a case-by-case basis.

So the question is, how do I get a hold of the JVM's default Trust Manager?

Thank you,
Yuriy
[ February 28, 2007: Message edited by: Yuriy Zilbergleyt ]
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know the answer to my question?

Thanks,
Yuriy
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can follow the following link:

http://java.sun.com/j2se/1.5.0/docs/guide/security/jsse/JSSERefGuide.html#TrustManager

The following code is copied from the above link and is what you want:

 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you!

Yuriy
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Here is a sample of code to get the JVM's default Trust Managers :


I get the following result on my Apple 1.6.0_17 JVM :

JVM Default Trust Managers:
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl@687b6889
Accepted issuers count : 163


Hope this helps,

Cyrille
 
I've been selected to go to the moon! All thanks to this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic