Package io.netty.handler.ssl
Class EnhancingX509ExtendedTrustManager
- java.lang.Object
-
- javax.net.ssl.X509ExtendedTrustManager
-
- io.netty.handler.ssl.EnhancingX509ExtendedTrustManager
-
- All Implemented Interfaces:
javax.net.ssl.TrustManager,javax.net.ssl.X509TrustManager
final class EnhancingX509ExtendedTrustManager extends javax.net.ssl.X509ExtendedTrustManagerWraps an existingX509ExtendedTrustManagerand enhances theCertificateExceptionthat is thrown because of hostname validation.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intALTNAME_DNS(package private) static intALTNAME_IP(package private) static intALTNAME_URIprivate static java.lang.StringSEPARATORprivate javax.net.ssl.X509ExtendedTrustManagerwrapped
-
Constructor Summary
Constructors Constructor Description EnhancingX509ExtendedTrustManager(javax.net.ssl.X509TrustManager wrapped)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckClientTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType)voidcheckClientTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType, java.net.Socket socket)voidcheckClientTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType, javax.net.ssl.SSLEngine engine)voidcheckServerTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType)voidcheckServerTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType, java.net.Socket socket)voidcheckServerTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType, javax.net.ssl.SSLEngine engine)java.security.cert.X509Certificate[]getAcceptedIssuers()private static java.lang.StringgetCommonName(java.security.cert.X509Certificate cert)private static java.lang.StringgetSNIHostName(javax.net.ssl.SSLSession session)private static voidthrowEnhancedCertificateException(java.security.cert.CertificateException e, java.security.cert.X509Certificate[] chain, javax.net.ssl.SSLSession session)
-
-
-
Field Detail
-
ALTNAME_DNS
static final int ALTNAME_DNS
- See Also:
- Constant Field Values
-
ALTNAME_URI
static final int ALTNAME_URI
- See Also:
- Constant Field Values
-
ALTNAME_IP
static final int ALTNAME_IP
- See Also:
- Constant Field Values
-
SEPARATOR
private static final java.lang.String SEPARATOR
- See Also:
- Constant Field Values
-
wrapped
private final javax.net.ssl.X509ExtendedTrustManager wrapped
-
-
Method Detail
-
checkClientTrusted
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType, java.net.Socket socket) throws java.security.cert.CertificateException- Specified by:
checkClientTrustedin classjavax.net.ssl.X509ExtendedTrustManager- Throws:
java.security.cert.CertificateException
-
checkServerTrusted
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType, java.net.Socket socket) throws java.security.cert.CertificateException- Specified by:
checkServerTrustedin classjavax.net.ssl.X509ExtendedTrustManager- Throws:
java.security.cert.CertificateException
-
checkClientTrusted
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType, javax.net.ssl.SSLEngine engine) throws java.security.cert.CertificateException- Specified by:
checkClientTrustedin classjavax.net.ssl.X509ExtendedTrustManager- Throws:
java.security.cert.CertificateException
-
checkServerTrusted
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType, javax.net.ssl.SSLEngine engine) throws java.security.cert.CertificateException- Specified by:
checkServerTrustedin classjavax.net.ssl.X509ExtendedTrustManager- Throws:
java.security.cert.CertificateException
-
checkClientTrusted
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType) throws java.security.cert.CertificateException- Throws:
java.security.cert.CertificateException
-
checkServerTrusted
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType) throws java.security.cert.CertificateException- Throws:
java.security.cert.CertificateException
-
getAcceptedIssuers
public java.security.cert.X509Certificate[] getAcceptedIssuers()
-
throwEnhancedCertificateException
private static void throwEnhancedCertificateException(java.security.cert.CertificateException e, java.security.cert.X509Certificate[] chain, javax.net.ssl.SSLSession session) throws java.security.cert.CertificateException- Throws:
java.security.cert.CertificateException
-
getSNIHostName
private static java.lang.String getSNIHostName(javax.net.ssl.SSLSession session)
-
getCommonName
private static java.lang.String getCommonName(java.security.cert.X509Certificate cert)
-
-