Top Description Fields Constructors Methods
org.apache.http.conn.ssl

public Class TrustAllStrategy

extends Object
implements TrustStrategy
Class Inheritance
All Implemented Interfaces
org.apache.http.conn.ssl.TrustStrategy, org.apache.http.ssl.TrustStrategy
Imports
java.security.cert.CertificateException, .X509Certificate

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

Field Summary

Modifier and TypeField and Description
public static final TrustAllStrategy

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
isTrusted(final X509Certificate[]
the peer certificate chain
chain
,
final String
the authentication type based on the client certificate
authType
)

Implements org.apache.http.ssl.TrustStrategy.isTrusted.

Determines whether the certificate chain can be trusted without consulting the trust manager configured in the actual SSL context.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final TrustAllStrategy INSTANCE

Constructor Detail

TrustAllStrategyback to summary
public TrustAllStrategy()

Method Detail

isTrustedback to summary
public boolean isTrusted(final X509Certificate[] chain, final String authType) throws CertificateException

Implements org.apache.http.ssl.TrustStrategy.isTrusted.

Doc from org.apache.http.ssl.TrustStrategy.isTrusted.

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.

Parameters
chain:X509Certificate[]

the peer certificate chain

authType:String

the authentication type based on the client certificate

Returns:boolean

true if the certificate can be trusted without verification by the trust manager, false otherwise.

Annotations
@Override
Exceptions
CertificateException:
thrown if the certificate is not trusted or invalid.