org.wikibooks.en.wiki.WebObjects.Web_Services.How_to_Trust_Any_SSL_Certificate
Class SSLUtilities

java.lang.Object
  extended by org.wikibooks.en.wiki.WebObjects.Web_Services.How_to_Trust_Any_SSL_Certificate.SSLUtilities

public final class SSLUtilities
extends java.lang.Object

This class provide various static methods that relax X509 certificate and hostname verification while using the SSL over the HTTP protocol.

Author:
Kristian Martin inspired by Francis Labrie
See Also:
Source: Article from Francis Labrie where, JavaTM Secure Socket Extension (JSSE) Reference Guide

Constructor Summary
SSLUtilities()
           
 
Method Summary
static void trustAllHostnames()
          Set the default Hostname Verifier to an instance of a fake class that trust all hostnames.
static void trustAllHostnames(java.net.URLConnection conn)
          Set the Hostname Verifier for this connection to an instance of a fake class that trust all hostnames.
static void trustAllHttpsCertificates()
          Set the default X509 Trust Manager to an instance of a fake class that trust all certificates, even the self-signed ones.
static void trustAllHttpsCertificates(java.net.URLConnection conn)
          Set the default X509 Trust Manager to an instance of a fake class that trust all certificates, even the self-signed ones.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SSLUtilities

public SSLUtilities()
Method Detail

trustAllHostnames

public static void trustAllHostnames()
Set the default Hostname Verifier to an instance of a fake class that trust all hostnames.


trustAllHttpsCertificates

public static void trustAllHttpsCertificates()
Set the default X509 Trust Manager to an instance of a fake class that trust all certificates, even the self-signed ones.


trustAllHostnames

public static void trustAllHostnames(java.net.URLConnection conn)
Set the Hostname Verifier for this connection to an instance of a fake class that trust all hostnames.


trustAllHttpsCertificates

public static void trustAllHttpsCertificates(java.net.URLConnection conn)
Set the default X509 Trust Manager to an instance of a fake class that trust all certificates, even the self-signed ones.