Package org.apache.http.ssl
Interface TrustStrategy
-
- All Known Subinterfaces:
TrustStrategy
- All Known Implementing Classes:
TrustAllStrategy,TrustSelfSignedStrategy
public interface TrustStrategyA strategy to establish trustworthiness of certificates without consulting the trust manager configured in the actual SSL context. This interface can be used to override the standard JSSE certificate verification process.- Since:
- 4.4
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType)Determines whether the certificate chain can be trusted without consulting the trust manager configured in the actual SSL context.
-
-
-
Method Detail
-
isTrusted
boolean isTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType) throws java.security.cert.CertificateExceptionDetermines 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 chainauthType- the authentication type based on the client certificate- Returns:
trueif the certificate can be trusted without verification by the trust manager,falseotherwise.- Throws:
java.security.cert.CertificateException- thrown if the certificate is not trusted or invalid.
-
-