Package com.helger.http.security
Class TrustManagerTrustAll
java.lang.Object
com.helger.http.security.TrustManagerTrustAll
- All Implemented Interfaces:
TrustManager,X509TrustManager
A trust manager that accepts all certificates.
- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor using the current debug mode fromGlobalDebug.TrustManagerTrustAll(boolean bDebug) Constructor with explicit debug flag. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckClientTrusted(X509Certificate[] aChain, String sAuthType) This implementation trusts all client certificates.voidcheckServerTrusted(X509Certificate[] aChain, String sAuthType) This implementation trusts all server certificates.@Nullable X509Certificate[]booleanisDebug()toString()
-
Constructor Details
-
TrustManagerTrustAll
public TrustManagerTrustAll()Constructor using the current debug mode fromGlobalDebug. -
TrustManagerTrustAll
public TrustManagerTrustAll(boolean bDebug) Constructor with explicit debug flag.- Parameters:
bDebug-trueto enable debug logging,falseto disable it.
-
-
Method Details
-
isDebug
public boolean isDebug()- Returns:
- The debug flag as passed in the constructor.
-
getAcceptedIssuers
- Specified by:
getAcceptedIssuersin interfaceX509TrustManager- Returns:
- Always
nullsince all issuers are accepted.
-
checkServerTrusted
This implementation trusts all server certificates.- Specified by:
checkServerTrustedin interfaceX509TrustManager- Parameters:
aChain- The peer certificate chain. May not benull.sAuthType- The authentication type based on the server certificate. May not benull.
-
checkClientTrusted
This implementation trusts all client certificates.- Specified by:
checkClientTrustedin interfaceX509TrustManager- Parameters:
aChain- The peer certificate chain. May not benull.sAuthType- The key exchange algorithm used. May not benull.
-
toString
-