org.apache.http.conn.ssl
Class TrustSelfSignedStrategy

java.lang.Object
  extended by org.apache.http.conn.ssl.TrustSelfSignedStrategy
All Implemented Interfaces:
TrustStrategy

public class TrustSelfSignedStrategy
extends Object
implements TrustStrategy

A trust strategy that accepts self-signed certificates as trusted. Verification of all other certificates is done by the trust manager configured in the SSL context.

Since:
4.1

Constructor Summary
TrustSelfSignedStrategy()
           
 
Method Summary
 boolean isTrusted(X509Certificate[] chain, String authType)
          Determines whether the certificate chain can be trusted without consulting the trust manager configured in the actual SSL context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrustSelfSignedStrategy

public TrustSelfSignedStrategy()
Method Detail

isTrusted

public boolean isTrusted(X509Certificate[] chain,
                         String authType)
                  throws CertificateException
Description copied from interface: TrustStrategy
Determines whether the certificate chain can be trusted without consulting the trust manager configured in the actual SSL context. This method can be used to override the standard JSSE certificate verification process.

Please note that, if this method returns false, the trust manager configured in the actual SSL context can still clear the certificate as trusted.

Specified by:
isTrusted in interface TrustStrategy
Parameters:
chain - the peer certificate chain
authType - the authentication type based on the client certificate
Returns:
true if the certificate can be trusted without verification by the trust manager, false otherwise.
Throws:
CertificateException - thrown if the certificate is not trusted or invalid.


Copyright © 1999-2013 The Apache Software Foundation. All Rights Reserved.