Package dev.aherscu.qa.testing.utils
Class TrustAllX509TrustManager
- java.lang.Object
-
- dev.aherscu.qa.testing.utils.TrustAllX509TrustManager
-
- All Implemented Interfaces:
TrustManager
,X509TrustManager
public class TrustAllX509TrustManager extends Object implements X509TrustManager
A 509 trust manager for debugging. Use to disable SSL certificate verification.- Author:
- Adrian Herscu
-
-
Field Summary
Fields Modifier and Type Field Description static SSLContext
TRUST_ALL_SSL_CONTEXT
-
Constructor Summary
Constructors Constructor Description TrustAllX509TrustManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkClientTrusted(X509Certificate[] certs, String authType)
void
checkServerTrusted(X509Certificate[] certs, String authType)
static void
disableSslCertificateValidation()
Disables SSL certificate and host validation.X509Certificate[]
getAcceptedIssuers()
-
-
-
Field Detail
-
TRUST_ALL_SSL_CONTEXT
public static final SSLContext TRUST_ALL_SSL_CONTEXT
-
-
Method Detail
-
disableSslCertificateValidation
public static void disableSslCertificateValidation()
Disables SSL certificate and host validation.Use as follows:
static { TrustAllX509TrustManager.disableSslCertificateValidation(); }
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] certs, String authType)
- Specified by:
checkClientTrusted
in interfaceX509TrustManager
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] certs, String authType)
- Specified by:
checkServerTrusted
in interfaceX509TrustManager
-
getAcceptedIssuers
public X509Certificate[] getAcceptedIssuers()
- Specified by:
getAcceptedIssuers
in interfaceX509TrustManager
-
-