Class EnhancingX509ExtendedTrustManager
java.lang.Object
javax.net.ssl.X509ExtendedTrustManager
io.netty.handler.ssl.EnhancingX509ExtendedTrustManager
- All Implemented Interfaces:
TrustManager, X509TrustManager
Wraps an existing
X509ExtendedTrustManager and enhances the CertificateException that is thrown
because of hostname validation.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int(package private) static final int(package private) static final intprivate static final Stringprivate final X509ExtendedTrustManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckClientTrusted(X509Certificate[] chain, String authType) voidcheckClientTrusted(X509Certificate[] chain, String authType, Socket socket) voidcheckClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine) voidcheckServerTrusted(X509Certificate[] chain, String authType) voidcheckServerTrusted(X509Certificate[] chain, String authType, Socket socket) voidcheckServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine) private static StringgetCommonName(X509Certificate cert) private static StringgetSNIHostName(SSLSession session) private static voidthrowEnhancedCertificateException(CertificateException e, X509Certificate[] chain, SSLSession session)
-
Field Details
-
ALTNAME_DNS
static final int ALTNAME_DNS- See Also:
-
ALTNAME_URI
static final int ALTNAME_URI- See Also:
-
ALTNAME_IP
static final int ALTNAME_IP- See Also:
-
SEPARATOR
- See Also:
-
wrapped
-
-
Constructor Details
-
EnhancingX509ExtendedTrustManager
EnhancingX509ExtendedTrustManager(X509TrustManager wrapped)
-
-
Method Details
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException - Specified by:
checkClientTrustedin classX509ExtendedTrustManager- Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException - Specified by:
checkServerTrustedin classX509ExtendedTrustManager- Throws:
CertificateException
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException - Specified by:
checkClientTrustedin classX509ExtendedTrustManager- Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException - Specified by:
checkServerTrustedin classX509ExtendedTrustManager- Throws:
CertificateException
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException - Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException - Throws:
CertificateException
-
getAcceptedIssuers
-
throwEnhancedCertificateException
private static void throwEnhancedCertificateException(CertificateException e, X509Certificate[] chain, SSLSession session) throws CertificateException - Throws:
CertificateException
-
getSNIHostName
-
getCommonName
-