Class InsecureExtendedTrustManager

  • All Implemented Interfaces:
    javax.net.ssl.TrustManager, javax.net.ssl.X509TrustManager

    public class InsecureExtendedTrustManager
    extends javax.net.ssl.X509ExtendedTrustManager
    An X509ExtendedTrustManager and X509TrustManager that will accept all server and client certificates. Before accepting a certificate, the InsecureExtendedTrustManager uses the default X509ExtendedTrustManager to determine if the certificate would otherwise be trusted, and logs a debug-level message if it is not trusted.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static javax.net.ssl.X509ExtendedTrustManager DEFAULT_EXTENDED_TRUST_MANAGER
      The default extended trust manager, which will be used to determine if certificates would otherwise be trusted.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkClientTrusted​(java.security.cert.X509Certificate[] x509Certificates, java.lang.String s)  
      void checkClientTrusted​(java.security.cert.X509Certificate[] x509Certificates, java.lang.String s, java.net.Socket socket)  
      void checkClientTrusted​(java.security.cert.X509Certificate[] x509Certificates, java.lang.String s, javax.net.ssl.SSLEngine sslEngine)  
      void checkServerTrusted​(java.security.cert.X509Certificate[] x509Certificates, java.lang.String s)  
      void checkServerTrusted​(java.security.cert.X509Certificate[] x509Certificates, java.lang.String s, java.net.Socket socket)  
      void checkServerTrusted​(java.security.cert.X509Certificate[] x509Certificates, java.lang.String s, javax.net.ssl.SSLEngine sslEngine)  
      java.security.cert.X509Certificate[] getAcceptedIssuers()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_EXTENDED_TRUST_MANAGER

        protected static final javax.net.ssl.X509ExtendedTrustManager DEFAULT_EXTENDED_TRUST_MANAGER
        The default extended trust manager, which will be used to determine if certificates would otherwise be trusted.
    • Constructor Detail

      • InsecureExtendedTrustManager

        public InsecureExtendedTrustManager()
    • Method Detail

      • checkClientTrusted

        public void checkClientTrusted​(java.security.cert.X509Certificate[] x509Certificates,
                                       java.lang.String s,
                                       java.net.Socket socket)
                                throws java.security.cert.CertificateException
        Specified by:
        checkClientTrusted in class javax.net.ssl.X509ExtendedTrustManager
        Throws:
        java.security.cert.CertificateException
      • checkServerTrusted

        public void checkServerTrusted​(java.security.cert.X509Certificate[] x509Certificates,
                                       java.lang.String s,
                                       java.net.Socket socket)
                                throws java.security.cert.CertificateException
        Specified by:
        checkServerTrusted in class javax.net.ssl.X509ExtendedTrustManager
        Throws:
        java.security.cert.CertificateException
      • checkClientTrusted

        public void checkClientTrusted​(java.security.cert.X509Certificate[] x509Certificates,
                                       java.lang.String s,
                                       javax.net.ssl.SSLEngine sslEngine)
                                throws java.security.cert.CertificateException
        Specified by:
        checkClientTrusted in class javax.net.ssl.X509ExtendedTrustManager
        Throws:
        java.security.cert.CertificateException
      • checkServerTrusted

        public void checkServerTrusted​(java.security.cert.X509Certificate[] x509Certificates,
                                       java.lang.String s,
                                       javax.net.ssl.SSLEngine sslEngine)
                                throws java.security.cert.CertificateException
        Specified by:
        checkServerTrusted in class javax.net.ssl.X509ExtendedTrustManager
        Throws:
        java.security.cert.CertificateException
      • checkClientTrusted

        public void checkClientTrusted​(java.security.cert.X509Certificate[] x509Certificates,
                                       java.lang.String s)
                                throws java.security.cert.CertificateException
        Throws:
        java.security.cert.CertificateException
      • checkServerTrusted

        public void checkServerTrusted​(java.security.cert.X509Certificate[] x509Certificates,
                                       java.lang.String s)
                                throws java.security.cert.CertificateException
        Throws:
        java.security.cert.CertificateException
      • getAcceptedIssuers

        public java.security.cert.X509Certificate[] getAcceptedIssuers()