org.openqa.selenium.server
Class TrustEverythingSSLTrustManager

java.lang.Object
  extended by org.openqa.selenium.server.TrustEverythingSSLTrustManager
All Implemented Interfaces:
TrustManager, X509TrustManager

public class TrustEverythingSSLTrustManager
extends Object
implements X509TrustManager

Provides a mechanism to trust all SSL certificates


Constructor Summary
TrustEverythingSSLTrustManager()
           
 
Method Summary
 void checkClientTrusted(X509Certificate[] certs, String authType)
           
 void checkServerTrusted(X509Certificate[] certs, String authType)
           
 X509Certificate[] getAcceptedIssuers()
           
static SSLSocketFactory getTrustingSSLSocketFactory()
          Returns an SSLSocketFactory that will trust all SSL certificates; this is suitable for passing to HttpsURLConnection, either to its instance method setSSLSocketFactory, or to its static method setDefaultSSLSocketFactory.
static void trustAllSSLCertificates(HttpsURLConnection connection)
          Configures a single HttpsURLConnection to trust all SSL certificates.
static void trustAllSSLCertificatesUniversally()
          Automatically trusts all SSL certificates in the current process; this is dangerous.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrustEverythingSSLTrustManager

public TrustEverythingSSLTrustManager()
Method Detail

getAcceptedIssuers

public X509Certificate[] getAcceptedIssuers()
Specified by:
getAcceptedIssuers in interface X509TrustManager

checkClientTrusted

public void checkClientTrusted(X509Certificate[] certs,
                               String authType)
Specified by:
checkClientTrusted in interface X509TrustManager

checkServerTrusted

public void checkServerTrusted(X509Certificate[] certs,
                               String authType)
Specified by:
checkServerTrusted in interface X509TrustManager

getTrustingSSLSocketFactory

public static SSLSocketFactory getTrustingSSLSocketFactory()
Returns an SSLSocketFactory that will trust all SSL certificates; this is suitable for passing to HttpsURLConnection, either to its instance method setSSLSocketFactory, or to its static method setDefaultSSLSocketFactory.

Returns:
SSLSocketFactory suitable for passing to HttpsUrlConnection
See Also:
HttpsURLConnection.setSSLSocketFactory(SSLSocketFactory), HttpsURLConnection.setDefaultSSLSocketFactory(SSLSocketFactory)

trustAllSSLCertificatesUniversally

public static void trustAllSSLCertificatesUniversally()
Automatically trusts all SSL certificates in the current process; this is dangerous. You should probably prefer to configure individual HttpsURLConnections with trustAllSSLCertificates

See Also:
trustAllSSLCertificates(HttpsURLConnection)

trustAllSSLCertificates

public static void trustAllSSLCertificates(HttpsURLConnection connection)
Configures a single HttpsURLConnection to trust all SSL certificates.

Parameters:
connection - an HttpsURLConnection which will be configured to trust all certs


Copyright © 2012. All Rights Reserved.