public class

TrustSelfSignedStrategy

extends Object
implements TrustStrategy
java.lang.Object
   ↳ org.apache.http.conn.ssl.TrustSelfSignedStrategy

Class Overview

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.

Summary

Public Constructors
TrustSelfSignedStrategy()
Public Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.http.conn.ssl.TrustStrategy

Public Constructors

public TrustSelfSignedStrategy ()

Also: HttpClient

Public Methods

public boolean isTrusted (X509Certificate[] chain, String authType)

Also: HttpClient

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 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.